forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix](tvf view)Support Table valued function view for nereids (apache…
…#23317) Nereids doesn't support view based table value function, because tvf view doesn't contain the proper qualifier (catalog, db and table name). This pr is to support this function. Also, fix nereids table value function explain output exprs incorrect bug.
- Loading branch information
Showing
6 changed files
with
107 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
regression-test/data/external_table_p2/tvf/test_tvf_view_p2.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !1 -- | ||
852910 | ||
|
||
-- !2 -- | ||
199147091 plum blush violet orange bisque Manufacturer#5 Brand#51 MEDIUM ANODIZED NICKEL 28 SM DRUM 1128.14 nding, final decoy | ||
199147092 brown tan chocolate moccasin peru Manufacturer#4 Brand#44 STANDARD BRUSHED COPPER 40 JUMBO PKG 1129.14 ully even acc | ||
199147093 white sandy burlywood orange powder Manufacturer#2 Brand#23 MEDIUM PLATED COPPER 15 MED PACK 1130.14 furiously special | ||
199147094 cyan almond olive steel navajo Manufacturer#1 Brand#15 ECONOMY BRUSHED STEEL 12 WRAP PACK 1131.14 dolites. | ||
199147095 linen moccasin snow deep dim Manufacturer#2 Brand#22 STANDARD POLISHED TIN 37 LG CASE 1132.14 furious | ||
199147096 dim violet ivory cream drab Manufacturer#4 Brand#44 MEDIUM ANODIZED COPPER 20 JUMBO CAN 1133.14 ions. sometime | ||
199147097 steel khaki smoke beige sienna Manufacturer#2 Brand#21 STANDARD BRUSHED BRASS 36 WRAP CASE 1134.14 und the blithely iron | ||
199147098 cornsilk red brown cyan moccasin Manufacturer#4 Brand#43 MEDIUM ANODIZED TIN 12 SM BOX 1135.14 hely across the | ||
199147099 slate wheat sienna almond spring Manufacturer#2 Brand#25 LARGE BURNISHED TIN 1 SM CAN 1136.14 uriously ironic packag | ||
199147100 orange gainsboro chocolate ivory grey Manufacturer#4 Brand#45 PROMO POLISHED BRASS 42 MED DRUM 1137.15 sual req | ||
|
||
-- !3 -- | ||
199147091 | ||
199147092 | ||
199147093 | ||
199147094 | ||
199147095 | ||
199147096 | ||
199147097 | ||
199147098 | ||
199147099 | ||
199147100 | ||
|
69 changes: 69 additions & 0 deletions
69
regression-test/suites/external_table_p2/tvf/test_tvf_view_p2.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
suite("test_tvf_view_p2", "p2,external,tvf,external_remote,external_remote_tvf") { | ||
String enabled = context.config.otherConfigs.get("enableExternalHiveTest") | ||
if (enabled != null && enabled.equalsIgnoreCase("true")) { | ||
String nameNodeHost = context.config.otherConfigs.get("extHiveHmsHost") | ||
String hdfsPort = context.config.otherConfigs.get("extHdfsPort") | ||
|
||
sql """drop database if exists test_tvf_view_p2""" | ||
sql """create database test_tvf_view_p2""" | ||
sql """use test_tvf_view_p2""" | ||
sql """set enable_fallback_to_original_planner=false""" | ||
sql """create view tvf_view as select * from hdfs ( | ||
"uri"="hdfs://${nameNodeHost}:${hdfsPort}:/usr/hive/warehouse/tpch_1000_parquet.db/part/000091_0", | ||
"fs.defaultFS"="hdfs://${nameNodeHost}:${hdfsPort}", | ||
"hadoop.username" = "hadoop", | ||
"format"="parquet");""" | ||
|
||
qt_1 """select count(*) from tvf_view""" | ||
qt_2 """select * from tvf_view order by p_partkey limit 10""" | ||
qt_3 """select p_partkey from tvf_view order by p_partkey limit 10""" | ||
explain{ | ||
sql("select * from tvf_view") | ||
contains("_table_valued_function_hdfs.p_partkey") | ||
contains("_table_valued_function_hdfs.p_name") | ||
contains("_table_valued_function_hdfs.p_mfgr") | ||
contains("_table_valued_function_hdfs.p_brand") | ||
contains("_table_valued_function_hdfs.p_type") | ||
contains("_table_valued_function_hdfs.p_size") | ||
contains("_table_valued_function_hdfs.p_container") | ||
contains("_table_valued_function_hdfs.p_retailprice") | ||
contains("_table_valued_function_hdfs.p_comment") | ||
} | ||
explain{ | ||
sql("select * from hdfs (\n" + | ||
" \"uri\"=\"hdfs://${nameNodeHost}:${hdfsPort}:/usr/hive/warehouse/tpch_1000_parquet.db/part/000091_0\",\n" + | ||
" \"fs.defaultFS\"=\"hdfs://${nameNodeHost}:${hdfsPort}\",\n" + | ||
" \"hadoop.username\" = \"hadoop\",\n" + | ||
" \"format\"=\"parquet\")") | ||
contains("_table_valued_function_hdfs.p_partkey") | ||
contains("_table_valued_function_hdfs.p_name") | ||
contains("_table_valued_function_hdfs.p_mfgr") | ||
contains("_table_valued_function_hdfs.p_brand") | ||
contains("_table_valued_function_hdfs.p_type") | ||
contains("_table_valued_function_hdfs.p_size") | ||
contains("_table_valued_function_hdfs.p_container") | ||
contains("_table_valued_function_hdfs.p_retailprice") | ||
contains("_table_valued_function_hdfs.p_comment") | ||
} | ||
|
||
sql """drop database if exists test_tvf_view_p2""" | ||
} | ||
} | ||
|