<?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: Table Fields Have a Different Value and Data Type in SQL Editor vs a SQL Notebook Cell in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/table-fields-have-a-different-value-and-data-type-in-sql-editor/m-p/130734#M48892</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/165035"&gt;@help_needed_445&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Good day!&lt;BR /&gt;&lt;BR /&gt;its very indeed interesting case study!&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;I found below from LLM models.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;Yes, this difference in decimal display between the Databricks SQL Editor (which uses the Photon engine in Databricks SQL) and notebooks (which use Spark SQL) is expected behavior related to how each interface handles formatting and schema inference for decimal types, particularly when dealing with underlying storage formats like Parquet in Delta tables.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;After this,&amp;nbsp;&amp;nbsp;I did create a table on MYSQL to check what is RDBMS is behaving, interstingly MySQL gave the solution as expected.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Khaja_Zaffer_0-1756943416899.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/19647i3DBD2CB75836ADE1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Khaja_Zaffer_0-1756943416899.png" alt="Khaja_Zaffer_0-1756943416899.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What I understand is from LLM models,&amp;nbsp;&lt;SPAN&gt;SQL Editor uses photon engine, if its true then it is having a different design, and the output is different.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;However, even LLM models failed to share any documentation link for reference on this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;can we have anyone check this on interactive cluster with photon acc. enabled. ( just to check may be I am not sure on this)&lt;BR /&gt;&lt;BR /&gt;Thank you.&amp;nbsp;&lt;BR /&gt;(&amp;nbsp;&lt;STRONG&gt;I am open to other solutions, it should be interesting to know this thing. :))&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Sep 2025 23:58:58 GMT</pubDate>
    <dc:creator>Khaja_Zaffer</dc:creator>
    <dc:date>2025-09-03T23:58:58Z</dc:date>
    <item>
      <title>Table Fields Have a Different Value and Data Type in SQL Editor vs a SQL Notebook Cell</title>
      <link>https://community.databricks.com/t5/data-engineering/table-fields-have-a-different-value-and-data-type-in-sql-editor/m-p/130729#M48888</link>
      <description>&lt;P&gt;When I query a numeric field in the SQL Editor it returns a value of 0.02875 and the data type is decimal but when I run the same query in a SQL notebook cell it returns&amp;nbsp;0.0287500 and decimal(7,7). I'm assuming this is expected behavior but is there any documentation on this? I found after looking at the table schema that&amp;nbsp;0.0287500 and decimal(7,7) are correct but it would be nice to have confirmation because I can't find info on this difference anywhere on the web. Is the notebook returning the raw table value and data type?&lt;/P&gt;&lt;P&gt;SQL Editor&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="help_needed_445_0-1756930330991.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/19645i776D140FDDF57E27/image-size/medium?v=v2&amp;amp;px=400" role="button" title="help_needed_445_0-1756930330991.png" alt="help_needed_445_0-1756930330991.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;SQL notebook cell&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="help_needed_445_1-1756930339286.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/19646iAD9BA281EFBD4C84/image-size/medium?v=v2&amp;amp;px=400" role="button" title="help_needed_445_1-1756930339286.png" alt="help_needed_445_1-1756930339286.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 20:15:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/table-fields-have-a-different-value-and-data-type-in-sql-editor/m-p/130729#M48888</guid>
      <dc:creator>help_needed_445</dc:creator>
      <dc:date>2025-09-03T20:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Table Fields Have a Different Value and Data Type in SQL Editor vs a SQL Notebook Cell</title>
      <link>https://community.databricks.com/t5/data-engineering/table-fields-have-a-different-value-and-data-type-in-sql-editor/m-p/130734#M48892</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/165035"&gt;@help_needed_445&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Good day!&lt;BR /&gt;&lt;BR /&gt;its very indeed interesting case study!&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;I found below from LLM models.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;Yes, this difference in decimal display between the Databricks SQL Editor (which uses the Photon engine in Databricks SQL) and notebooks (which use Spark SQL) is expected behavior related to how each interface handles formatting and schema inference for decimal types, particularly when dealing with underlying storage formats like Parquet in Delta tables.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;After this,&amp;nbsp;&amp;nbsp;I did create a table on MYSQL to check what is RDBMS is behaving, interstingly MySQL gave the solution as expected.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Khaja_Zaffer_0-1756943416899.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/19647i3DBD2CB75836ADE1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Khaja_Zaffer_0-1756943416899.png" alt="Khaja_Zaffer_0-1756943416899.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What I understand is from LLM models,&amp;nbsp;&lt;SPAN&gt;SQL Editor uses photon engine, if its true then it is having a different design, and the output is different.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;However, even LLM models failed to share any documentation link for reference on this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;can we have anyone check this on interactive cluster with photon acc. enabled. ( just to check may be I am not sure on this)&lt;BR /&gt;&lt;BR /&gt;Thank you.&amp;nbsp;&lt;BR /&gt;(&amp;nbsp;&lt;STRONG&gt;I am open to other solutions, it should be interesting to know this thing. :))&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 23:58:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/table-fields-have-a-different-value-and-data-type-in-sql-editor/m-p/130734#M48892</guid>
      <dc:creator>Khaja_Zaffer</dc:creator>
      <dc:date>2025-09-03T23:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Table Fields Have a Different Value and Data Type in SQL Editor vs a SQL Notebook Cell</title>
      <link>https://community.databricks.com/t5/data-engineering/table-fields-have-a-different-value-and-data-type-in-sql-editor/m-p/130999#M48965</link>
      <description>&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;I also asked an LLM and got a lot of information I couldn't find via google or the databricks website. It said basically that the SQL editor performs certain actions to show a more&amp;nbsp;"user-friendly" value.&lt;/P&gt;&lt;P&gt;For example:&lt;BR /&gt;1. Showing a simplified data type label&lt;BR /&gt;2. Trimming trailing zeros for display&lt;/P&gt;&lt;P&gt;There are probably others but I think the big idea is that a notebook should probably be used to get the actual values that are in a table.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 13:37:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/table-fields-have-a-different-value-and-data-type-in-sql-editor/m-p/130999#M48965</guid>
      <dc:creator>help_needed_445</dc:creator>
      <dc:date>2025-09-05T13:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Table Fields Have a Different Value and Data Type in SQL Editor vs a SQL Notebook Cell</title>
      <link>https://community.databricks.com/t5/data-engineering/table-fields-have-a-different-value-and-data-type-in-sql-editor/m-p/131162#M48995</link>
      <description>&lt;P&gt;You are right!&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I believe it would be much more than user-friendly internally.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Sep 2025 10:16:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/table-fields-have-a-different-value-and-data-type-in-sql-editor/m-p/131162#M48995</guid>
      <dc:creator>Khaja_Zaffer</dc:creator>
      <dc:date>2025-09-07T10:16:05Z</dc:date>
    </item>
  </channel>
</rss>

