<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Free Edition CrossValidator not working because of internal caching in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/free-edition-crossvalidator-not-working-because-of-internal/m-p/162162#M4647</link>
    <description>&lt;P&gt;What you are encountering is an expected behavior on Databricks serverless. Because &lt;STRONG&gt;CrossValidator&lt;/STRONG&gt; (along with other Spark ML tuning estimators) relies heavily on internal DataFrame &lt;STRONG&gt;caching&lt;/STRONG&gt; to optimize iterative model training, Databricks enforces strict security and data isolation boundaries on it. This underlying architecture dictates that any temporary storage utilized for caching must be explicitly routed to a &lt;STRONG&gt;Unity Catalog (UC) Volume&lt;/STRONG&gt;, rather than relying on local, ephemeral cluster storage.&lt;/P&gt;&lt;P&gt;You can set the &lt;STRONG&gt;SPARKML_TEMP_DFS_PATH&lt;/STRONG&gt; environment variable at the beginning of the notebook, strictly prior to instantiating your &lt;STRONG&gt;CrossValidator&lt;/STRONG&gt;. Because notebook-level variables do not persist across cluster restarts, this must be &lt;STRONG&gt;executed&lt;/STRONG&gt; at the &lt;STRONG&gt;start of every session&lt;/STRONG&gt;.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="python"&gt;import os

# Create a UC volume for Spark ML temporary storage
spark.sql("CREATE VOLUME IF NOT EXISTS main.default.spark_ml_temp")

# Set the environment variable (required in every session)
os.environ["SPARKML_TEMP_DFS_PATH"] = "/Volumes/main/default/spark_ml_temp"&lt;/LI-CODE&gt;&lt;P&gt;You will need to create a standard UC Volume specifically designated for temporary ML storage. You can use any valid UC volume path, provided the executing user or service principal has the requisite &lt;STRONG&gt;WRITE VOLUME &lt;/STRONG&gt;privileges on the path.&lt;/P&gt;&lt;P&gt;Be aware that this internal caching behavior is &lt;STRONG&gt;not exclusive&lt;/STRONG&gt; to &lt;STRONG&gt;CrossValidator&lt;/STRONG&gt;. If you are utilizing &lt;STRONG&gt;TrainValidationSplit&lt;/STRONG&gt; or &lt;STRONG&gt;other native Spark ML estimators&lt;/STRONG&gt; that trigger &lt;STRONG&gt;DataFrame caching&lt;/STRONG&gt;, you will need to implement this exact same volume mapping to avoid runtime failures.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jul 2026 03:01:34 GMT</pubDate>
    <dc:creator>balajij8</dc:creator>
    <dc:date>2026-07-08T03:01:34Z</dc:date>
    <item>
      <title>Free Edition CrossValidator not working because of internal caching</title>
      <link>https://community.databricks.com/t5/machine-learning/free-edition-crossvalidator-not-working-because-of-internal/m-p/162149#M4646</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am getting the following error when using CrossValidator in Databricks Free Edition v5 (see attachment):&lt;/P&gt;&lt;P&gt;In shared or serverless cluster, SPARK_ML_TMP_DFS_PATH environmental variable must be set to a UC volume path like '/Volumes/...' in order to support Saprk DataFrame caching&lt;/P&gt;&lt;P&gt;Could you please check if this the expected behaviour, and if there a workaround or something we can try?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2026 21:05:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/free-edition-crossvalidator-not-working-because-of-internal/m-p/162149#M4646</guid>
      <dc:creator>pjvi</dc:creator>
      <dc:date>2026-07-07T21:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Free Edition CrossValidator not working because of internal caching</title>
      <link>https://community.databricks.com/t5/machine-learning/free-edition-crossvalidator-not-working-because-of-internal/m-p/162162#M4647</link>
      <description>&lt;P&gt;What you are encountering is an expected behavior on Databricks serverless. Because &lt;STRONG&gt;CrossValidator&lt;/STRONG&gt; (along with other Spark ML tuning estimators) relies heavily on internal DataFrame &lt;STRONG&gt;caching&lt;/STRONG&gt; to optimize iterative model training, Databricks enforces strict security and data isolation boundaries on it. This underlying architecture dictates that any temporary storage utilized for caching must be explicitly routed to a &lt;STRONG&gt;Unity Catalog (UC) Volume&lt;/STRONG&gt;, rather than relying on local, ephemeral cluster storage.&lt;/P&gt;&lt;P&gt;You can set the &lt;STRONG&gt;SPARKML_TEMP_DFS_PATH&lt;/STRONG&gt; environment variable at the beginning of the notebook, strictly prior to instantiating your &lt;STRONG&gt;CrossValidator&lt;/STRONG&gt;. Because notebook-level variables do not persist across cluster restarts, this must be &lt;STRONG&gt;executed&lt;/STRONG&gt; at the &lt;STRONG&gt;start of every session&lt;/STRONG&gt;.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;LI-CODE lang="python"&gt;import os

# Create a UC volume for Spark ML temporary storage
spark.sql("CREATE VOLUME IF NOT EXISTS main.default.spark_ml_temp")

# Set the environment variable (required in every session)
os.environ["SPARKML_TEMP_DFS_PATH"] = "/Volumes/main/default/spark_ml_temp"&lt;/LI-CODE&gt;&lt;P&gt;You will need to create a standard UC Volume specifically designated for temporary ML storage. You can use any valid UC volume path, provided the executing user or service principal has the requisite &lt;STRONG&gt;WRITE VOLUME &lt;/STRONG&gt;privileges on the path.&lt;/P&gt;&lt;P&gt;Be aware that this internal caching behavior is &lt;STRONG&gt;not exclusive&lt;/STRONG&gt; to &lt;STRONG&gt;CrossValidator&lt;/STRONG&gt;. If you are utilizing &lt;STRONG&gt;TrainValidationSplit&lt;/STRONG&gt; or &lt;STRONG&gt;other native Spark ML estimators&lt;/STRONG&gt; that trigger &lt;STRONG&gt;DataFrame caching&lt;/STRONG&gt;, you will need to implement this exact same volume mapping to avoid runtime failures.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2026 03:01:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/free-edition-crossvalidator-not-working-because-of-internal/m-p/162162#M4647</guid>
      <dc:creator>balajij8</dc:creator>
      <dc:date>2026-07-08T03:01:34Z</dc:date>
    </item>
  </channel>
</rss>

