Open taiyang-li opened 1 month ago
i would like to take this project
@ayushwth already assign to you, have fun!
The number of placeholders (%d%s) didn't match the number of arguments (1, 'hello', 2) Either remove the extra argument or add an appropriate placeholder in the format string to match the number of arguments.
Corrected snippet:
select printf('%d%s%d', 1, 'hello', 2);
I think removing the extra argument makes sense, because gluten need to output the same result with Vanilla Spark.
BTW, you could implement by implement a ScalarFunctionParser for substrait function format_string
. An example https://github.com/apache/incubator-gluten/blob/main/cpp-ch/local-engine/Parser/scalar_function_parser/concat.cpp
substrait format_string(format, arg1, arg2...)
-> CH printf(format, arg1, arg2...)
If we assume the first argument format
is literal
Alrigth, here:
format_string(%d%s, 1, hello, 2)
-> CH printf('%d%s', 1, 'hello');
the argument2
was withdrawn from the q to avoid bad argument
Can you please give me a proper explanation to the bug solution, that would help me learn more
Alrigth, here:
format_string(%d%s, 1, hello, 2)
->CH printf('%d%s', 1, 'hello');
the argument2
was withdrawn from the q to avoid bad argument
Yes, the solution is right.
Description
when actual args number exceeds expected args number, SPARK will ignore it, and CH will throw exception.
会报类似的错