Details
Description
When parsing a string that contains Spark's "corr" function, Calcite will throw a SqlParseException.
Minimal reproducible example:
import org.apache.calcite.sql.dialect.SparkSqlDialect; import org.apache.calcite.sql.parser.SqlParseException; import org.apache.calcite.sql.parser.SqlParser; class Scratch { public static void main(String[] args) throws SqlParseException { // Example SQL provided by spark, see https://spark.apache.org/docs/latest/api/sql/#corr String sqlQuery = "SELECT corr(c1, c2) FROM VALUES (3, 2), (3, 3), (6, 4) as tab(c1, c2);"; SqlParser.create(sqlQuery, SparkSqlDialect.DEFAULT.configureParser(SqlParser.config())).parseQuery(); } }
Output:
Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: Encountered "corr" at line 1, column 8.
Attachments
Issue Links
- duplicates
-
CALCITE-1776 Implement CORR and REGR_* aggregate functions
- Open