<?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: Cannot up cast sizeInBytes from string to bigint in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87106#M37379</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/52939"&gt;@brickster&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The error message in the screenshot indicates that there is an issue with casting sizeInBytes from STRING torelated to the SnapshotState in Delta Lake. This is not caused by the columns you are trying to create in your Delta table but rather relates to internal metadata managed by Delta Lake.&lt;BR /&gt;&lt;BR /&gt;What it means is that most likely the metadata of Delta table is corrupt. For example you created the table, then you dropped it, but still there are some leftover files in the table location.&lt;/P&gt;&lt;P&gt;You need to clean-up the table location before recreating it to make sure there are no older files anymore.&lt;BR /&gt;&lt;BR /&gt;Here are the steps:&lt;BR /&gt;1. Table creation (this is already done):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%sql
CREATE TABLE test_transact (transaction_id string, post_date date)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Check the table location&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;%sql
DESCRIBE DETAIL test_transact;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filipniziol_0-1725184349733.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/10836i11FA282540FD9801/image-size/medium?v=v2&amp;amp;px=400" role="button" title="filipniziol_0-1725184349733.png" alt="filipniziol_0-1725184349733.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;-&amp;gt; this is what you want to clean-up before recreating the table&lt;/P&gt;&lt;P&gt;3. Drop the table -&amp;gt; if the metadata is corrupt, some files will not be removed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%sql
DROP TABLE IF EXISTS test_transact&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. Show the content of the location (copy-paste from point 2.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;display(dbutils.fs.ls("dbfs:/user/hive/warehouse/test_transact"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the metadata is corrupt, you will see some files there even after DROP TABLE:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filipniziol_1-1725184567975.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/10837i17C3D6AA4B9BEAE6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="filipniziol_1-1725184567975.png" alt="filipniziol_1-1725184567975.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;5. Clean-up the TABLE location:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;dbutils.fs.rm("dbfs:/user/hive/warehouse/test_transact", recurse=True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;6. Try now to recreate the table and insert the data.&lt;/P&gt;</description>
    <pubDate>Sun, 01 Sep 2024 10:01:54 GMT</pubDate>
    <dc:creator>filipniziol</dc:creator>
    <dc:date>2024-09-01T10:01:54Z</dc:date>
    <item>
      <title>Cannot up cast sizeInBytes from string to bigint</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87054#M37368</link>
      <description>&lt;P&gt;I am creating a basic delta table using CREATE SQL query&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CREATE TABLE test_transact (transaction_id string, post_date date)&lt;/LI-CODE&gt;&lt;P&gt;and running this query throws an error "Cannot up cast sizeInBytes from string to bigint"&lt;/P&gt;&lt;P&gt;Even if I try to create a dataframe and save as table,&lt;/P&gt;&lt;LI-CODE lang="python"&gt;df.write.format("delta").mode("overwrite").saveAsTable("test_transact")&lt;/LI-CODE&gt;&lt;P&gt;same error appears, despite there is no column sizeInBytes being used.&lt;/P&gt;&lt;P&gt;However, I can able to create temp view using df.createOrReplaceTempView("test_transact")&lt;/P&gt;&lt;P&gt;My cluster DBR version is 14.3 LTS ML (Spark 3.5.0, Scala 2.12)&lt;/P&gt;&lt;P&gt;Can anyone encountered such issue? Appreciate you help... here is the screenshot&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2024 14:50:35 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87054#M37368</guid>
      <dc:creator>brickster</dc:creator>
      <dc:date>2024-08-31T14:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot up cast sizeInBytes from string to bigint</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87094#M37371</link>
      <description>&lt;P&gt;Without being able to see the previous cells in the notebook, it's not possible to pinpoint your exact root cause, but the error indicates that the issue lies with an implicit cast of transaction_id. sizeInBytes is not being referred to as a field, it is a field attribute base on data type, that cannot be manipulated by the cited SQL statement or df method for creating a Table. Per your report, the df method that instantiates a View is more flexible. For the purpose of Table creation, the verbose error is suggesting that you attend to your casting explicitly at ingestion (which I assume is happening in an earlier cell in the same notebook).&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.databricks.com/en/error-messages/error-classes.html#cannot_up_cast_datatype" target="_blank"&gt;https://docs.databricks.com/en/error-messages/error-classes.html#cannot_up_cast_datatype&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2024 00:39:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87094#M37371</guid>
      <dc:creator>nickmerritt</dc:creator>
      <dc:date>2024-09-01T00:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot up cast sizeInBytes from string to bigint</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87097#M37372</link>
      <description>&lt;P&gt;It looks like there's an issue between the datatype of a field between the source and the target. Perhaps in your CREATE you are implicitly casting that transaction_id? I'm just going off of similar discussions here in the community, and I cannot speak to the cells before screenshot cell in your notebook, but your verbose error message wants you to explicitly cast something (I suspect transaction_id) prior to the CREATE statement, i.e. earlier in your notebook, at ingestion.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://docs.databricks.com/en/error-messages/error-classes.html#cannot_up_cast_datatype" target="_blank"&gt;https://docs.databricks.com/en/error-messages/error-classes.html#cannot_up_cast_datatype&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2024 01:30:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87097#M37372</guid>
      <dc:creator>nickmerritt</dc:creator>
      <dc:date>2024-09-01T01:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot up cast sizeInBytes from string to bigint</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87099#M37374</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/52939"&gt;@brickster&lt;/a&gt;, How are you doing today?&lt;/P&gt;&lt;P&gt;As per my understanding,&amp;nbsp;Try &lt;STRONG&gt;dropping any existing table or metadata&lt;/STRONG&gt; related to &lt;STRONG&gt;test_transact&amp;nbsp;&lt;/STRONG&gt;before creating it to avoid conflicts. Consider using a &lt;STRONG&gt;different table name&lt;/STRONG&gt; or creating it in a new schema to bypass potential metadata issues. Explicitly define the &lt;STRONG&gt;schema in your DataFrame&lt;/STRONG&gt; to prevent type inference problems. &lt;STRONG&gt;Restart your cluster&lt;/STRONG&gt; to clear any cached sessions or metadata causing the error. Lastly, check for &lt;STRONG&gt;DBR version compatibility&lt;/STRONG&gt; with Delta Lake, and consider trying a different DBR version if the issue persists.&lt;/P&gt;&lt;P&gt;Just give a try and let me know if it works. Good day.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brahma&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2024 04:10:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87099#M37374</guid>
      <dc:creator>Brahmareddy</dc:creator>
      <dc:date>2024-09-01T04:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot up cast sizeInBytes from string to bigint</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87100#M37375</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/52939"&gt;@brickster&lt;/a&gt;, How are you doing today?&lt;/P&gt;&lt;P&gt;As per my understanding,&amp;nbsp;Try &lt;STRONG&gt;dropping any existing table or metadata&lt;/STRONG&gt; related to &lt;STRONG&gt;test_transact&amp;nbsp;&lt;/STRONG&gt;before creating it to avoid conflicts. Consider using a &lt;STRONG&gt;different table name&lt;/STRONG&gt; or creating it in a new schema to bypass potential metadata issues. Explicitly define the &lt;STRONG&gt;schema in your DataFrame&lt;/STRONG&gt; to prevent type inference problems. &lt;STRONG&gt;Restart your cluster&lt;/STRONG&gt; to clear any cached sessions or metadata causing the error. Lastly, check for &lt;STRONG&gt;DBR version compatibility&lt;/STRONG&gt; with Delta Lake, and consider trying a different DBR version if the issue persists.&lt;/P&gt;&lt;P&gt;Just give a try and let me know if it works. Have a good day.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brahma&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2024 04:11:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87100#M37375</guid>
      <dc:creator>Brahmareddy</dc:creator>
      <dc:date>2024-09-01T04:11:55Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot up cast sizeInBytes from string to bigint</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87101#M37376</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/52939"&gt;@brickster&lt;/a&gt;, How are you doing today?&lt;/P&gt;&lt;P&gt;Try &lt;STRONG&gt;dropping any existing table or metadata&lt;/STRONG&gt; related to test_transact before creating it to avoid conflicts. Consider using a &lt;STRONG&gt;different table name&lt;/STRONG&gt; or creating it in a new schema to bypass potential metadata issues. Explicitly define the &lt;STRONG&gt;schema in your DataFrame&lt;/STRONG&gt; to prevent type inference problems. &lt;STRONG&gt;Restart your cluster&lt;/STRONG&gt; to clear any cached sessions or metadata causing the error. Lastly, check for &lt;STRONG&gt;DBR version compatibility&lt;/STRONG&gt; with Delta Lake, and consider trying a different DBR version if the issue persists.&lt;/P&gt;&lt;P&gt;Give a try.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Brahma&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2024 04:13:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87101#M37376</guid>
      <dc:creator>Brahmareddy</dc:creator>
      <dc:date>2024-09-01T04:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot up cast sizeInBytes from string to bigint</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87105#M37378</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/52939"&gt;@brickster&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The error message in the screenshot indicates that there is an issue with casting sizeInBytes from STRING to BIGINT related to the SnapshotState in Delta Lake. This is not caused by the columns you are trying to create in your Delta table but rather relates to internal metadata managed by Delta Lake.&lt;BR /&gt;&lt;BR /&gt;What it means is that most likely the metadata of Delta table is corrupt. For example you created the table, then you dropped it, but still there are some leftover files in the table location.&lt;/P&gt;&lt;P&gt;You need to clean-up the table location before recreating it to make sure there are no older files anymore.&lt;BR /&gt;&lt;BR /&gt;Here are the steps:&lt;BR /&gt;1. Table creation (this is already done):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%sql
CREATE TABLE test_transact (transaction_id string, post_date date)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Check the table location&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;%sql
DESCRIBE DETAIL test_transact;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filipniziol_0-1725184349733.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/10836i11FA282540FD9801/image-size/medium?v=v2&amp;amp;px=400" role="button" title="filipniziol_0-1725184349733.png" alt="filipniziol_0-1725184349733.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;-&amp;gt; this is what you want to clean-up before recreating the table&lt;/P&gt;&lt;P&gt;3. Drop the table -&amp;gt; if the metadata is corrupt, some files will not be removed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%sql
DROP TABLE IF EXISTS test_transact&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. Show the content of the location (copy-paste from point 2.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;display(dbutils.fs.ls("dbfs:/user/hive/warehouse/test_transact"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the metadata is corrupt, you will see some files there even after DROP TABLE:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filipniziol_1-1725184567975.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/10837i17C3D6AA4B9BEAE6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="filipniziol_1-1725184567975.png" alt="filipniziol_1-1725184567975.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;5. Clean-up the TABLE location:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;dbutils.fs.rm("dbfs:/user/hive/warehouse/test_transact", recurse=True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;6. Try now to recreate the table and insert the data.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2024 09:59:56 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87105#M37378</guid>
      <dc:creator>filipniziol</dc:creator>
      <dc:date>2024-09-01T09:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot up cast sizeInBytes from string to bigint</title>
      <link>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87106#M37379</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/52939"&gt;@brickster&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The error message in the screenshot indicates that there is an issue with casting sizeInBytes from STRING torelated to the SnapshotState in Delta Lake. This is not caused by the columns you are trying to create in your Delta table but rather relates to internal metadata managed by Delta Lake.&lt;BR /&gt;&lt;BR /&gt;What it means is that most likely the metadata of Delta table is corrupt. For example you created the table, then you dropped it, but still there are some leftover files in the table location.&lt;/P&gt;&lt;P&gt;You need to clean-up the table location before recreating it to make sure there are no older files anymore.&lt;BR /&gt;&lt;BR /&gt;Here are the steps:&lt;BR /&gt;1. Table creation (this is already done):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%sql
CREATE TABLE test_transact (transaction_id string, post_date date)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Check the table location&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;%sql
DESCRIBE DETAIL test_transact;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filipniziol_0-1725184349733.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/10836i11FA282540FD9801/image-size/medium?v=v2&amp;amp;px=400" role="button" title="filipniziol_0-1725184349733.png" alt="filipniziol_0-1725184349733.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;-&amp;gt; this is what you want to clean-up before recreating the table&lt;/P&gt;&lt;P&gt;3. Drop the table -&amp;gt; if the metadata is corrupt, some files will not be removed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%sql
DROP TABLE IF EXISTS test_transact&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. Show the content of the location (copy-paste from point 2.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;display(dbutils.fs.ls("dbfs:/user/hive/warehouse/test_transact"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the metadata is corrupt, you will see some files there even after DROP TABLE:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="filipniziol_1-1725184567975.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/10837i17C3D6AA4B9BEAE6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="filipniziol_1-1725184567975.png" alt="filipniziol_1-1725184567975.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;5. Clean-up the TABLE location:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;dbutils.fs.rm("dbfs:/user/hive/warehouse/test_transact", recurse=True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;6. Try now to recreate the table and insert the data.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2024 10:01:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/cannot-up-cast-sizeinbytes-from-string-to-bigint/m-p/87106#M37379</guid>
      <dc:creator>filipniziol</dc:creator>
      <dc:date>2024-09-01T10:01:54Z</dc:date>
    </item>
  </channel>
</rss>

