Open lqy222 opened 10 months ago
It is caused by not handling ExprType.kExprCast
in ConstProjectPlan.
Since the offline output does not consist of column data, we need to fix the output of ConstProjectPlan first. Otherwise we can only get the output column name date("2020-05-22")
but no exactly data.
+----------------+
|date(2020-05-22)|
+----------------+
+----------------+
Here is the simple code to reproduce the issue.
import com._4paradigm.openmldb.batch.SparkTestSuite
import com._4paradigm.openmldb.batch.api.OpenmldbSession
import com._4paradigm.openmldb.batch.end2end.DataUtil
import com._4paradigm.openmldb.batch.utils.SparkUtil
class TestProject extends SparkTestSuite {
test("Test end2end window aggregation") {
val spark = getSparkSession
val sess = new OpenmldbSession(spark)
val df = DataUtil.getTestDf(spark)
sess.registerTable("t1", df)
df.createOrReplaceTempView("t1")
val sql2 = "SELECT date('2024-01-01') FROM t1"
val sql3 = "select int(1.1)"
val sql = "select date('2020-05-22')"
val outputDf = sess.sql(sql)
outputDf.show()
}
}
select date("2020-05-22");
below SQL not support in offline mode