-
Notifications
You must be signed in to change notification settings - Fork 461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] Spark assert_true and raise_error function support #5991
Comments
Is the two function implemented in Presto list or Spark list? |
|
looks if we can make a generic solution to let gluten always call |
I see. just talked with @zhli1142015 on the interval issue. We need a fundamental way to test all the Spark functions. @rui-mo Can your velox_Spark fuzzer test achieve this? |
It's different issue from input_file_name(). If we can implement the function in Velox, we should do that firstly. |
so please check my this try
|
No, we should use the same data type as Spark. Can assert_true return unknown_type in velox? null_type is implemented as unknown_type in velox. |
@gaoyangxiaozhu, velox doesn't support UnknownType (NullType) for function output? I remember this type is supported for input. |
|
Summary: This PR adds Spark `raise_error` function. It is re-used in Spark `assert_true` function, so after this PR `assert_true` can also be supported. Spark document: https://spark.apache.org/docs/latest/api/sql/#raise_error Spark code: https://github.com/apache/spark/blob/branch-3.5/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala#L85C1-L92C1 Issue: apache/incubator-gluten#5991 Pull Request resolved: #10110 Reviewed By: kevinwilfong Differential Revision: D59252851 Pulled By: bikramSingh91 fbshipit-source-id: d41347bed8265825bb415e8604179b38ecc89bc8
Description
spark
assert_true
andraise_error
function not compatible with current velox type system and function register interface.as below query a example,
it would generate
void
type andNullType
in output schema which would convert to unknown type in velox, forraise_error
, it expect void return type but velox function always expect a non-void return type.One way i tried is convert
raise_error
from void return type to string type but it need we update not only expression itself but also the output type schema also from NullType to StringType, otherwise would encounter mem allocation issue based on my local test.Update:
RaiseError
's data type is NullType. Ditto forAssertTrue
as it is replaced byIF
+RaiseError
.https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala#L82
@zhouyuan / @PHILO-HE / @FelixYBW
The text was updated successfully, but these errors were encountered: