<?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: Replay a stream after converting to liquid cluster failes in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121013#M46303</link>
    <description>&lt;P&gt;It looks like the table is a streaming source and head(1) is not allowed. limit(1) is allowed but your not allowed to inspect the dataframe until a batch streaming process is started.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jun 2025 07:31:42 GMT</pubDate>
    <dc:creator>EndreM</dc:creator>
    <dc:date>2025-06-05T07:31:42Z</dc:date>
    <item>
      <title>Replay a stream after converting to liquid cluster failes</title>
      <link>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/120931#M46280</link>
      <description>&lt;P&gt;I have problem replaying a stream.&lt;BR /&gt;I need to replay it because conversion from liquid cluster&lt;BR /&gt;to partition doesnt work. I see a lot of garbage collection&lt;BR /&gt;and memory maxes out immediatly. Then the driver restarts.&lt;/P&gt;&lt;P&gt;TO debug the problem I try to force only 1 record to be read so I run:&lt;BR /&gt;reader = reader.load(bronze_path).select("*", "_metadata").limit(1)&lt;BR /&gt;print("going to collect reader. Only 1 record")&lt;BR /&gt;reader.collect()&lt;BR /&gt;&lt;BR /&gt;This gives error:&lt;BR /&gt;File /databricks/spark/python/pyspark/sql/connect/client/core.py:2155, in SparkConnectClient._handle_rpc_error(self, rpc_error)&lt;BR /&gt;2140 raise Exception(&lt;BR /&gt;2141 "Python versions in the Spark Connect client and server are different. "&lt;BR /&gt;2142 "To execute user-defined functions, client and server should have the "&lt;BR /&gt;(...)&lt;BR /&gt;2151 "&lt;A href="https://docs.databricks.com/en/release-notes/serverless.html" target="_blank"&gt;https://docs.databricks.com/en/release-notes/serverless.html&lt;/A&gt;" target="_blank" rel="noopener noreferrer"&amp;gt;&lt;A href="https://docs.databricks.com/en/release-notes/serverless.html" target="_blank"&gt;https://docs.databricks.com/en/release-notes/serverless.html&lt;/A&gt;&amp;lt;/a&amp;gt;.&amp;lt;/span&amp;gt;&amp;lt;span&amp;gt;"&lt;BR /&gt;2152 )&lt;BR /&gt;2153 # END-EDGE&lt;BR /&gt;-&amp;gt; 2155 raise convert_exception(&lt;BR /&gt;2156 info,&lt;BR /&gt;2157 status.message,&lt;BR /&gt;2158 self._fetch_enriched_error(info),&lt;BR /&gt;2159 self._display_server_stack_trace(),&lt;BR /&gt;2160 ) from None&lt;BR /&gt;2162 raise SparkConnectGrpcException(status.message) from None&lt;BR /&gt;2163 else:&lt;BR /&gt;&lt;BR /&gt;And this is the explanation chatgpt gives which i find strange since its running on databricks:&lt;BR /&gt;This error usually means there's a mismatch between the Python versions (or environments) used by your Spark Connect client and the Spark server. When you call collect(), Spark Connect tries to run user‐defined code, and if the Python versions differ the operation fails.&lt;/P&gt;&lt;P&gt;To fix this you should ensure that:&lt;/P&gt;&lt;P&gt;• The Python version in your client environment (where you're running the code) exactly matches the Python version configured on the Spark server/cluster.&lt;/P&gt;&lt;P&gt;• All relevant libraries are consistent between client and server.&lt;/P&gt;&lt;P&gt;Once they match, the collect() call should work without the RPC error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 13:42:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/120931#M46280</guid>
      <dc:creator>EndreM</dc:creator>
      <dc:date>2025-06-04T13:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Replay a stream after converting to liquid cluster failes</title>
      <link>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/120994#M46301</link>
      <description>&lt;P&gt;Hi&amp;nbsp;EndreM,&lt;/P&gt;&lt;P&gt;How are you doing today? As per my understanding, From what you’ve described, it looks like the error might be caused by a mismatch in the Python versions between your Databricks Connect client (if you're using something like PyCharm or VS Code) and the Databricks runtime on the cluster. Even though it seems strange since you're running on Databricks, using .collect() or similar actions through Spark Connect can sometimes fail if the environments don’t match exactly. A simple workaround is to try running the same code directly in a Databricks notebook instead of through your IDE—this helps ensure everything is aligned. Also, instead of .limit(1).collect(), try using .sample(False, 0.0001).take(1) or .head(1) which can be lighter and avoid scanning the whole dataset. Let me know if you'd like help reviewing your streaming setup or tuning cluster memory—happy to help you sort it out smoothly!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brahma&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 05:31:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/120994#M46301</guid>
      <dc:creator>Brahmareddy</dc:creator>
      <dc:date>2025-06-05T05:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Replay a stream after converting to liquid cluster failes</title>
      <link>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121007#M46302</link>
      <description>&lt;P&gt;Thanks, ill try the method. I did run from a&amp;nbsp;&lt;SPAN&gt;Databricks notebook. Our stream is defined with 3 notebooks as well as a library. I have previously got an error when the library was build with an old python version and I upgraded databricks to 15.4. So I havnt found this error and I find it strange when running the code in a databricks notebook.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:40:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121007#M46302</guid>
      <dc:creator>EndreM</dc:creator>
      <dc:date>2025-06-05T06:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Replay a stream after converting to liquid cluster failes</title>
      <link>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121013#M46303</link>
      <description>&lt;P&gt;It looks like the table is a streaming source and head(1) is not allowed. limit(1) is allowed but your not allowed to inspect the dataframe until a batch streaming process is started.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 07:31:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121013#M46303</guid>
      <dc:creator>EndreM</dc:creator>
      <dc:date>2025-06-05T07:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Replay a stream after converting to liquid cluster failes</title>
      <link>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121026#M46309</link>
      <description>&lt;P&gt;I get another error which is perhaps related to this error:&lt;/P&gt;&lt;P&gt;com.databricks.unity.error.MissingCredentialScopeException: [UNITY_CREDENTIAL_SCOPE_MISSING_SCOPE] Missing Credential Scope. Failed to find Unity Credential Scope.. SQLSTATE: XXKUC&lt;BR /&gt;at com.databricks.unity.error.MissingCredentialScopeException$.withDebugLog(UCSExceptions.scala:62)&lt;BR /&gt;at com.databricks.unity.UCSExecutor.$anonfun$currentScope$1(UCSExecutor.scala:82)&lt;BR /&gt;at scala.Option.getOrElse(Option.scala:189)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is unity catalog not setup correctly?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 10:41:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121026#M46309</guid>
      <dc:creator>EndreM</dc:creator>
      <dc:date>2025-06-05T10:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: Replay a stream after converting to liquid cluster failes</title>
      <link>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121070#M46328</link>
      <description>&lt;P&gt;Hey EndreM,&amp;nbsp;Thanks a lot for the extra info!&lt;/P&gt;&lt;P&gt;Since you're running this from a Databricks notebook and still getting the Python version mismatch earlier, and now seeing a MissingCredentialScopeException, it strongly points to a misconfiguration related to Unity Catalog permissions or the identity used to access the data. The error suggests that Unity Catalog is expecting a credential scope (essentially, permission context) that’s not available in your current session—this usually happens when your cluster or user identity doesn't have access to the underlying external location or the credential isn't properly scoped to your workspace or catalog.&lt;/P&gt;&lt;P&gt;To fix this, here are a few suggestions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Check External Location Permissions: Make sure the external location (like your S3 path) is registered and you have the correct privileges set using GRANT in Unity Catalog.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Verify Credential Scope Setup: Go to the Unity Catalog configuration in your workspace and confirm that the external location is linked with a valid credential and a storage credential scope. You can do this via the UI or with CREATE/ALTER EXTERNAL LOCATION and CREATE/GRANT STORAGE CREDENTIAL.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Cluster Access Mode: If you’re using a shared or assigned cluster, make sure it’s in Shared Access Mode—this is required to work with Unity Catalog, especially with fine-grained permissions.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Library Compatibility: Double-check that your custom library was rebuilt with Python 3.10 (the default in DBR 15.4), and no old .pyc or mismatched wheel files are lingering.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Once Unity Catalog permissions and scopes are configured properly, and your cluster is using the correct access mode, this kind of credential error should go away. Let me know if you want help checking the config or writing any of the SQL commands—I’m happy to help you get this sorted!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brahma&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 15:50:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121070#M46328</guid>
      <dc:creator>Brahmareddy</dc:creator>
      <dc:date>2025-06-05T15:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Replay a stream after converting to liquid cluster failes</title>
      <link>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121121#M46344</link>
      <description>&lt;P&gt;I dont know the answer to the first 2 questions, but its a shared compute, and the library is build with python 3.12 (compatible with 3.11 and 3.10). The compute is on databricks 15.4.&lt;/P&gt;&lt;P&gt;The problem is related to this question:&amp;nbsp;&lt;A href="https://community.databricks.com/t5/data-engineering/replay-stream-to-migrate-to-liquid-cluster/m-p/121059#M46322" target="_blank" rel="noopener"&gt;https://community.databricks.com/t5/data-engineering/replay-stream-to-migrate-to-liquid-cluster/m-p/121059#M46322&lt;/A&gt;&lt;/P&gt;&lt;P&gt;By limiting the number of records we transform from bronze to silver I was able to stream 100 records to silver with liquid clustering. So perhaps access control is not an issue. However the full transformation which for one record in bronze perhaps produce 200 000 records in silver - the job either times out (with G1GC garbage collector) or the driver restarts with the parallel garbage collector. This job ran fine when silver table was partitioned and unity catalog was not enabled.&lt;/P&gt;&lt;P&gt;Please reach out!&lt;/P&gt;&lt;P&gt;Kind regards, Endre&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2025 08:30:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121121#M46344</guid>
      <dc:creator>EndreM</dc:creator>
      <dc:date>2025-06-06T08:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Replay a stream after converting to liquid cluster failes</title>
      <link>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121138#M46350</link>
      <description>&lt;P&gt;After granting more permissions for users to the table I also see this in the log:&lt;/P&gt;&lt;P&gt;chown: invalid user: ‘null:spark-users’&lt;BR /&gt;chown: invalid user: ‘null:spark-users’&lt;BR /&gt;do_all_setup_for_username: iptables command took 0.0015606880187988281 seconds&lt;BR /&gt;do_all_setup_for_username: set_process_identity took 0.0005297660827636719 seconds&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "&amp;lt;frozen runpy&amp;gt;", line 198, in _run_module_as_main&lt;BR /&gt;File "&amp;lt;frozen runpy&amp;gt;", line 88, in _run_code&lt;BR /&gt;File "/databricks/spark/python/pyspark/sql/connect/streaming/worker/foreach_batch_worker.py", line 154, in &amp;lt;module&amp;gt;&lt;BR /&gt;(sock_file, sock) = local_connect_and_auth(java_port, auth_secret)&lt;BR /&gt;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;BR /&gt;File "/databricks/spark/python/pyspark/util.py", line 726, in local_connect_and_auth&lt;BR /&gt;raise PySparkRuntimeError(&lt;BR /&gt;pyspark.errors.exceptions.base.PySparkRuntimeError: [CANNOT_OPEN_SOCKET] Can not open socket: ["tried to connect to ('127.0.0.1', 45771), but an error occurred: [Errno 111] Connection refused"].&lt;BR /&gt;do_all_setup_for_username: iptables command took 0.0020797252655029297 seconds&lt;BR /&gt;do_all_setup_for_username: set_process_identity took 0.0008292198181152344 seconds&lt;BR /&gt;Streaming foreachBatch worker is starting with url unix:///databricks/sparkconnect/grpc.sock and root sessionId 8a167574-1d44-4777-9309-c455c7fceab2.&lt;BR /&gt;finished setting up the root session 8a167574-1d44-4777-9309-c455c7fceab2.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2025 12:58:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121138#M46350</guid>
      <dc:creator>EndreM</dc:creator>
      <dc:date>2025-06-06T12:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Replay a stream after converting to liquid cluster failes</title>
      <link>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121294#M46409</link>
      <description>&lt;P&gt;After increasing the compute to one with 500 GB memory, the job was able to transfer ca 300 GB of data, but it produced a large amount of files, 26000. While the old table with partition and no liquid cluster had 4000 files with a total of 1.2 TB of data. Why does liquid cluster or unity catalog result in so many files being produced?&lt;/P&gt;&lt;P&gt;It looks like the job ran for more than 2 days, but there is no record of the job run in the logs, and subsequently running the job times out after 3 hours. The data is only 1.2 TB and even with 500 GB of memory it looks like it is not enough... How to resolve this issue?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its a lot less flexibility and tooling available in debugging any PySpark issues in databricks than debugging a Kafka pipeline. When using Kafka you have the option to do low level coding in Apache Kafka, while also getting a lot out of the box functionality from higher level library Apache Steams. Peeking under the hood of what is going on isnt possible in Databricks. Quite frustrating.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 07:17:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/replay-a-stream-after-converting-to-liquid-cluster-failes/m-p/121294#M46409</guid>
      <dc:creator>EndreM</dc:creator>
      <dc:date>2025-06-10T07:17:33Z</dc:date>
    </item>
  </channel>
</rss>

