cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Internal Error when querying a doubleType column of a delta table using ">" "<" operators

Christoph
New Contributor II

Hi there,

we are currently facing a pretty confusing issue:

We have a delta table (~2TB) which has been working just fine over the last few years and months. For a few days or weeks now, querying the table on one of its columns, let´s call it double_column, from datatype DoubleType, using ">" "<" operators, results in an error.

So a query like...

SELECT * FROM example_table WHERE double_column > 1

... would throw an error, whereas using "==" or "!="... works just fine.

The following error is thrown:

AssertionError: assertion failed
org.apache.spark.SparkException: [INTERNAL_ERROR] The Spark SQL phase planning failed with an internal error. You hit a bug in Spark or the Spark plugins you use. Please, report this bug to the corresponding communities or vendors, and provide the full stack trace.

However, querying an older version of the table works  just fine:

SELECT * FROM example_table VERSION AS OF 100 WHERE double_column > 1

...returns the desired result.

 

What´s even more confusing, when we query the latest version of the table using...

SELECT * FROM example_table VERSION AS OF 500 [this is the latest version] WHERE double_column > 1

...it works as well, even though it should query the same state of the table as the first query, right?

 

Would be nice if anyone has some suggestions on how to fix this 🙂

kind regards
Christoph

3 REPLIES 3

-werners-
Esteemed Contributor III

Nice 🙂
Do you happen to use a Photon cluster?  If so, can you run a test without Photon?

Christoph
New Contributor II

No, Photon was not activated on any of the clusters I tried running the queries on.

The easiest solution for this problem is casting the column double_column to FloatType. Then it works as expected again, I coudn´t figure out why though. So this will be our short term fix, but still we would like to understand this issue 😄 

-werners-
Esteemed Contributor III

it might be a bug which is already logged, or a new one.  You can check the Spark Jira pages.

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!