You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/08/02 08:52:52 UTC

[GitHub] [calcite] xy2953396112 commented on a change in pull request #2092: [CALCITE-1581] Support UDTF like Hive

xy2953396112 commented on a change in pull request #2092:
URL: https://github.com/apache/calcite/pull/2092#discussion_r464051650



##########
File path: core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java
##########
@@ -1121,7 +1121,58 @@ public final Sql sql(String sql) {
     sql("select * from dept, lateral table(ramp(dept.deptno))").ok();
   }
 
-  @Test void testCollectionTableWithLateral2() {
+  @Test public void testTableFunctionInSelect() {
+    sql("select table_func(dept.deptno) as (f0, f1) from dept")
+        .conformance(SqlConformance.HIVE)
+        .ok();
+  }
+
+  @Test public void testTableFunctionInSelectWithUnion() {
+    sql("select * from ("
+        + "select a.deptno, table_func(a.deptno) as (f0, f1)"

Review comment:
       There is a few limitations in Hive[1].Other expressions are not allowed in SELECT.
   `No other expressions are allowed in SELECT
   SELECT pageid, explode(adid_list) AS myCol... is not supported`
   [1] [https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-explode(array)](https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-explode(array))
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org