This is an automated email from the ASF dual-hosted git repository. kxiao pushed a commit to branch branch-2.0 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 682088984c1642e15a4131955c23ddbb77f20895 Author: amory <[email protected]> AuthorDate: Tue Aug 15 13:11:23 2023 +0800 [FIX](map)insert into doris table with array/map type by local tvf (#22955) --- be/src/olap/rowset/segment_v2/column_reader.cpp | 7 +- .../data/external_table_p0/tvf/comp.orc | Bin 0 -> 1966 bytes .../data/external_table_p0/tvf/comp.parquet | Bin 0 -> 11341 bytes ...ocal_tvf_with_complex_type_insertinto_doris.out | 80 +++++++++++++++++++++ ...l_tvf_with_complex_type_insertinto_doris.groovy | 79 ++++++++++++++++++++ 5 files changed, 164 insertions(+), 2 deletions(-) diff --git a/be/src/olap/rowset/segment_v2/column_reader.cpp b/be/src/olap/rowset/segment_v2/column_reader.cpp index 2e4db26c50..03f29a6451 100644 --- a/be/src/olap/rowset/segment_v2/column_reader.cpp +++ b/be/src/olap/rowset/segment_v2/column_reader.cpp @@ -135,8 +135,6 @@ Status ColumnReader::create(const ColumnReaderOptions& opts, const ColumnMetaPB& } case FieldType::OLAP_FIELD_TYPE_MAP: { // map reader now has 3 sub readers for key, value, offsets(scalar), null(scala) - std::unique_ptr<ColumnReader> map_reader( - new ColumnReader(opts, meta, num_rows, file_reader)); std::unique_ptr<ColumnReader> key_reader; RETURN_IF_ERROR(ColumnReader::create(opts, meta.children_columns(0), meta.children_columns(0).num_rows(), file_reader, @@ -155,6 +153,11 @@ Status ColumnReader::create(const ColumnReaderOptions& opts, const ColumnMetaPB& meta.children_columns(3).num_rows(), file_reader, &null_reader)); } + + // The num rows of the map reader equals to the num rows of the length reader. + num_rows = meta.children_columns(2).num_rows(); + std::unique_ptr<ColumnReader> map_reader( + new ColumnReader(opts, meta, num_rows, file_reader)); map_reader->_sub_readers.resize(meta.children_columns_size()); map_reader->_sub_readers[0] = std::move(key_reader); diff --git a/regression-test/data/external_table_p0/tvf/comp.orc b/regression-test/data/external_table_p0/tvf/comp.orc new file mode 100644 index 0000000000..77d6dd5062 Binary files /dev/null and b/regression-test/data/external_table_p0/tvf/comp.orc differ diff --git a/regression-test/data/external_table_p0/tvf/comp.parquet b/regression-test/data/external_table_p0/tvf/comp.parquet new file mode 100644 index 0000000000..ea746c2d65 Binary files /dev/null and b/regression-test/data/external_table_p0/tvf/comp.parquet differ diff --git a/regression-test/data/external_table_p0/tvf/test_local_tvf_with_complex_type_insertinto_doris.out b/regression-test/data/external_table_p0/tvf/test_local_tvf_with_complex_type_insertinto_doris.out new file mode 100644 index 0000000000..932b27b65c --- /dev/null +++ b/regression-test/data/external_table_p0/tvf/test_local_tvf_with_complex_type_insertinto_doris.out @@ -0,0 +1,80 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !sql -- +0 + +-- !sql -- +0 + +-- !sql -- +2 {1:[0.35815922932906263, 0.0011899152357573994, 0.28749219850167373, 0.93512930168283781, 0.1552584991620739, 0.73308976093672584, 0.52815960653805338, 0.92936404769642733, 0.89084215295591418, 0.21986459138832559], 2:[0.25076205844319044, 0.54003619330849928, 0.70661164863002113, 0.99472899095144263, 0.078314941019622886, 0.44206845606243961, 0.30857433265707379, 0.048661247184825784, 0.76954870938240083, 0.27253204080482074], 3:[0.687619207224633, 0.81614795840545351, 0.8866348164721 [...] + +-- !sql -- +1 + +-- !sql -- +2 {1:[0.35815922932906263, 0.0011899152357573994, 0.28749219850167373, 0.93512930168283781, 0.1552584991620739, 0.73308976093672584, 0.52815960653805338, 0.92936404769642733, 0.89084215295591418, 0.21986459138832559], 2:[0.25076205844319044, 0.54003619330849928, 0.70661164863002113, 0.99472899095144263, 0.078314941019622886, 0.44206845606243961, 0.30857433265707379, 0.048661247184825784, 0.76954870938240083, 0.27253204080482074], 3:[0.687619207224633, 0.81614795840545351, 0.8866348164721 [...] + +-- !sql -- +50 {5:[0.0805668018581458, 0.56751024600175393, 0.086756816058294217], 4:NULL, 2:[0.38665070404516133, 0.27363095817403738, 0.34854625766951086], 0:[0.025456093624682374, 0.43295502354537052, 0.10342370810142731, 0.673986645671262]} {"GyELt5-XM7p3Mp-pUp-Y6TD":{"VvylVT-srxX9Ck-XsN-Yr58":0.92549562290400178, "5gOFaY-uDnHRxk-UPH-we5L":0.24457848181013797, "c6SSkD-kPV8Czr-JqL-DxlE":0.20486363523944195, "x8pe01-Hy1cfS5-4vi-E1kU":0.26844008458047974}} +51 {3:[0.78535062886651474, 0.19530298980291305, 0.82274947966575651, 0.57456358216295356, 0.10599288799846596, 0.39764934489047621, 0.51795746073876048], 7:[0.16070456646011266, 0.21622384654359439, 0.56499626756102206, 0.72436522397859471, 0.82689046273989342, 0.22650887858691748, 0.32479201632413013]} {"4otnat-06sRoIc-KbX-PkSN":{"o23H5u-idPYROb-sw2-BQhg":0.85773612726715764, "iJpcEr-1QxMiLf-8aC-riuH":0.03472786196768185, "tKrDuc-Tj4UVIe-C57-4mbf":0.86687892273671452, "YJZ2UI-2PN7S1W-i [...] +52 {0:[0.62615541893380477, 0.95529554839136432, 0.050730598464887144, 0.761698822315222, 0.80097400922586182, 0.70937695669061984], 5:[0.62829741017499841, 0.99919407074570377, 0.23510344788227955, 0.069021645160855516, 0.6642318482893439, 0.9974935200158882], 6:[0.096952964273770093, 0.23922857266269104, 0.846224571908401, 0.87146585941421051, 0.53052946534784406, 0.6305106935161614], 9:[0.39275946491137603, 0.66377199224436567, 0.077114224016427313, 0.43485635822176161, 0.175692114544 [...] +53 {0:NULL, 4:[0.65266799993546065, 0.11840912909620105]} {"glGz8W-Jzn5yan-qEL-SFgy":{"C4BIKV-aEandHf-xla-LRzW":0.22358537808347978, "GOFbpr-x52KThj-aKy-HV7F":0.83659888142243366, "o1n5KE-DgUY81C-tcC-OL4Q":0.035902339181033582}} +54 {7:[0.59320825804184385, 0.460039302772568, 0.90394502926182008, 0.45976237364292183, 0.54427996873292928], 4:[0.60400955940603684, 0.1179781621960635, 0.054480238266918279, 0.51396478978712468, 0.16301849677559921, 0.93635339321496047], 0:NULL, 5:[0.99554525790228077, 0.94498931565118727, 0.40693028978907797, 0.81030985598971417, 0.799750141732691, 0.18095132253143864]} {"qShR1x-3NrIm5N-O9R-fukB":{"uXEPQj-LuWrGEk-BKS-L9gQ":0.098931042165366967, "dLI446-OUk42lG-6ci-k68f":0.99855144476 [...] +55 {0:[0.06106407334414421, 0.077519447583608181], 8:[0.977318070315718, 0.21828389231565848, 0.43289221013701307, 0.86875555142643635], 2:[0.81063763152261414, 0.20641371630459315, 0.78885531594886116]} {"27r2Ca-AxlNBhg-r7z-SPZ0":{"RxuNhx-wsVMLvT-9hR-PcwI":0.11951614997496263, "FtPDZ4-K9ZvUKU-8Ur-VoVG":0.36999657416815812, "bLdezi-TF11R2v-7lt-wbtY":0.818115150860844, "521V4E-GlCoVaL-Jyf-n5Nw":0.71210133502368567, "onY3wU-XhasJ7a-YlJ-2mlW":0.14628789539110221}} +56 {6:NULL, 0:[0.14265810711006088]} {"JLwX2N-xqTuG6v-Hlf-Ldm2":{"rWb6Kl-fKrn6uu-OrN-FjZI":0.37136010587470325, "WeOIpw-i2XsiCy-9so-uvbU":0.25939055495493146, "1IVUby-DW4NC11-ImH-MCBp":0.82167413145208235, "rImjso-ltgUA0j-HOI-tPrk":0.20831660777224315}} +57 {2:[]} {"IhDLwI-ocNCsSk-iFe-tnYH":{"818ZTI-D2tIL7b-eXZ-es5L":0.62522246291032291, "70sv6h-z7GzsCj-Qbh-kdKi":0.89663028593313043, "MuCpL6-RhL3a1z-u6j-cZ5h":0.836931303563489}} +58 {0:[0.68067777761797, 0.35955837539117619, 0.58946414625791255, 0.7605109448827565, 0.71877033105933363, 0.411403335391371, 0.70213099900915377], 1:[0.54981215293989916, 0.056095646585538672, 0.53041486199861354, 0.62145446215452382, 0.65001103807811489, 0.86164244211406282, 0.611465611565057], 6:[0.19681731890143883, 0.53609201576719812, 0.4813512505819646, 0.38776339288060946, 0.94073108501158786, 0.76104761891050077, 0.64725208219807184], 7:[0.10482812611408332, 0.48028128556853644 [...] +59 {0:[0.9229706867471863, 0.073213375262793812, 0.56932834172049374, 0.87755967293437687, 0.22830035453062369, 0.41194062327361958, 0.07755038754687138], 1:[0.7033499830719242, 0.15080152894131182, 0.67600997025217091, 6.8389054328821253e-05, 0.56251276203337874, 0.57602870310196574, 0.4341019944699861, 0.2833670280022168], 6:[0.64265030086692776, 0.721729336639443, 0.70228317338777235, 0.85521198892310679, 0.19709722556747045, 0.87630691599825172], 7:[0.078627135670950032, 0.8982600399 [...] +60 {2:NULL, 9:[0.68817051068356083, 0.58866705765486893, 0.9770647663621238]} {"2eZZuZ-gPnSceD-I4d-moBg":{"CDuRMK-JH8MfuY-ogq-QiQS":0.061575881523062148, "3WYdO0-XltW1HK-hjM-LNlz":0.86164972492374081, "SxBfEK-pIiMQV6-qwZ-B2rj":0.80341434305286941}} +61 {3:[0.070139380310141552, 0.506328788814395]} {"wRXXT8-84Ukmsm-9Z0-QQDD":{"iThEPc-88gotHW-3D1-Mzwd":0.64810102378016332, "jgiZHL-sQ5oYtk-lHD-syb9":0.76291191407360859}} +62 {9:[0.58994620551878041, 0.18139479750515208, 0.25347123483258072, 0.17111987154863106, 0.26414173446363864, 0.20043217143263392, 0.96164911996602531, 0.65884593534283165], 2:[0.22072083425913747, 0.83821892208162152, 0.67969347796297908, 0.99354319783022, 0.066764795168193447, 0.24733422096006119, 0.8413728913196975, 0.052434404533342693], 7:NULL, 3:[0.988163551682917, 0.13489137067371493, 0.81955620653116534, 0.87247312085219286, 0.16470424817608276, 0.17277816013666891, 0.633896463 [...] +63 {0:[0.07031040534337929, 0.91642829694443262, 0.42182730565188331, 0.39344287833455016, 0.54413120712133223, 0.64299161716796815, 0.62227129307615114], 5:[0.52378173910528536, 0.083159015968547134, 0.90123102014092771, 0.11414082965239369, 0.13673732422864793, 0.896264199789972], 9:NULL, 2:[0.70420519158521711, 0.16762130311811219, 0.92543637480558816, 0.55243625344578728, 0.50436327153092764, 0.36777783134719244], 7:[0.75192736597252685, 0.53671286841638255, 0.18945139793706278, 0.43 [...] +64 {0:NULL, 1:[0.011337485043372064, 0.058960286266133033, 0.0772734354492185, 0.44817124168857858, 0.075220641394569854, 0.8469227637503236, 0.47789453059202847], 9:NULL, 8:[0.96286794729691028, 0.30132565991582017, 0.40461567749408589, 0.64454059875346614, 0.24362602733441763, 0.658068827069971, 0.49295725084987296, 0.88221725574215], 4:[0.089946187244476672, 0.2026907246184031, 0.39235341775543364, 0.1159462120157938, 0.8579443369615477, 0.33975535108683252, 0.5036460914380616, 0.6626 [...] +65 {9:[0.94746404068041457, 0.4867395388849417, 0.40686742056048641, 0.93664324996441717, 0.82497815074271619], 7:NULL, 3:NULL, 8:[0.81824759690610938, 0.80479836141754835, 0.53531597548132892, 0.60036813561764024, 0.11247050474369835, 0.85158863187467182, 0.83383491806156063], 4:[0.61830122794311282, 0.57004917882179, 0.29718449172240657, 0.74453860793269644, 0.53943646049688254, 0.99362849561450006, 0.94952638994277028]} {"9Y25Kk-FTeKyYe-CXr-JUfh":{"nGDwja-Tm8i0At-ImM-izMt":0.979781096 [...] +66 {8:[0.07566122576479517, 0.17372499693102306, 0.83934147737452147, 0.042763224017711932, 0.056944544232054639, 0.66417796747605984, 0.70451120188556149], 4:[0.68524319688266189, 0.39286986935274704, 0.27885508309721962, 0.68519652860132241, 0.50558242548912513, 0.24796144257644304, 0.65049574030345447, 0.43785350251783872], 0:[0.089368313040567249, 0.34125025522474739, 0.44676122153353715, 0.22340149213914762, 0.897182830659752, 0.434185820612778, 0.417426913606436, 0.5545817038159385 [...] +67 {2:NULL, 7:[0.91150902115621757, 0.45059596918526212, 0.33693263304933307, 0.5080615851211272, 0.16511017235132264], 5:[0.28458623602477562, 0.015463155009067808, 0.88518091701252566, 0.19725880943436114, 0.701663575912497, 0.28822203463178708], 3:[0.50857932562343156, 0.43794389999855821, 0.60159902715505187, 0.72004191241526516, 0.91116008640342683, 0.18958726729319353, 0.87370199265374726]} {"dAmin3-xHBtJcE-biY-4f0H":{"d2uRgP-FujFmv4-1Y2-WVIz":0.3515740009388636, "zjY8sk-k5i7dtq-em [...] +68 {5:NULL, 4:[0.88776492865883971, 0.15172448941722771]} {"OSv79P-NAKtGCu-iyi-pPV6":{"d8eb60-hYg0WNF-Fs1-ee1P":0.41997621858538559, "us1TRR-qBtBpyw-Yu3-qZAW":0.8332894211873183}} +69 {6:NULL, 9:[0.020526475919481979, 0.43454245170903083, 0.28669439551470954, 0.75204337758826467, 0.65766593526266148, 0.12150151074992488, 0.16339981205596821, 0.89788901629073115], 2:[0.90048711147861016, 0.4667497643734968, 0.9720865410157381, 0.79242581730160078, 0.16695158265619969, 0.86677266780939122], 3:[0.13462209821494608, 0.38210006325077062, 0.79006030065447685, 0.15166472165405853, 0.581151141639526, 0.38818315992944719, 0.72704482517055635, 0.95370678633722883], 4:[0.0741 [...] +70 {5:NULL, 9:[0.08033091566184658, 0.6062860491776022, 0.96902261094764319, 0.33531531491369793, 0.15421114611317288, 0.95525027438171617, 0.58220748862550331], 2:[0.95923051936525583, 0.99940603203117007, 0.99272399601641514, 0.64675167937166544, 0.0011247984267567235, 0.31355616337391412], 8:[0.33301272307830621, 0.7882504403400048, 0.23685292607925712, 0.73631462477721343, 0.53222169916482176, 0.98412860777863131], 4:[0.41853920705055514, 0.55088467934996677, 0.34225589803839818, 0.9 [...] +71 {9:[0.915160233678902, 0.56218532673784483, 0.022671147471926778], 1:[0.3913504433229803, 0.52307414691003007, 0.49793665693307521, 0.0582947785812834, 0.96119799392692207], 8:NULL, 4:[0.032458360383276652, 0.059237302147171156, 0.50542827372121779]} {"3gAq26-R29c6wX-C0r-lmSu":{"tLP9u3-l2SMVmB-mjG-Jl6w":0.22269082321242084, "Vk3Xgs-p8nevgI-1kh-g2Ln":0.31023019325466172, "VWTV7E-WmoiHa1-Azx-p4uv":0.96594565649777042, "4vCeAM-M09o72Y-MM7-kuq0":0.57476584826863852, "tw99RS-AigR4BN-Cvx-Tt [...] +72 {3:[0.39467746014773986, 0.68089927382163351, 0.17672102367531073, 0.075743536456418625], 1:[0.023318989228810372, 0.76939749383205125, 0.42440547182594346]} {"zDDKlD-skEk2ps-KRo-u1B5":{"iK1yJB-yuEElEZ-li4-vxAT":0.43894802430489277, "4kF6cZ-Cwlf33s-eYD-92Dy":0.97378869646008837, "AyE8nj-ecfHXG1-XuB-ye3B":0.69671634023926254, "CwYJPz-oSaS398-CfV-MOLZ":0.9422562276573786, "xMk5Ob-lCuzA3R-yXs-NLnc":0.31773598018625049}} +73 {2:NULL, 0:NULL, 6:[0.90930407184363815, 0.72654347099786309, 0.77713676166409162, 0.45170100734912888, 0.20561721946523071], 4:[0.55661944239801686, 0.35338583959188696, 0.96078559790357065, 0.9820835035863047]} {"qWb5pY-zDUMBmJ-vWd-t5OQ":{"w0rNjY-66fzAGv-ClT-3wmn":0.53013685341276817, "IO8Vxz-oR7Lf59-vv2-zAh5":0.12968326682140918, "Ogdlby-ZH9sYXd-JdY-ba7O":0.97051029399409849, "oBN81K-JDVgHQA-9Lh-L9BZ":0.013752450408350381, "sUMCB1-rKPSp71-F9O-PyDS":0.7630437343408194, "myAfbD-b27OH [...] +74 {0:NULL, 5:[0.38119307563566651, 0.69249939434627483, 0.38599629448088613, 0.52482148944126283, 0.9523606741851619, 0.76548572122519165], 1:NULL, 7:[0.029714818398116627, 0.55036459290071282, 0.76723075431337873, 0.43448030331230347], 8:[0.20352306482252491, 0.75913355077838607, 0.29383475821077176, 0.89161452923324014, 0.52920363634562007]} {"SwlnEW-OUq8a53-1k3-j9M5":{"RelKZ3-etM12wN-uP4-XR7Z":0.28928123482977663, "FEpfM2-MGtIq1y-Ily-hqLN":0.75982378533995065, "Dy4lap-sNXoyV3-LBz-ikj [...] + +-- !sql -- +25 + +-- !sql_count -- +26 + +-- !sql -- +2 {1:[0.35815922932906263, 0.0011899152357573994, 0.28749219850167373, 0.93512930168283781, 0.1552584991620739, 0.73308976093672584, 0.52815960653805338, 0.92936404769642733, 0.89084215295591418, 0.21986459138832559], 2:[0.25076205844319044, 0.54003619330849928, 0.70661164863002113, 0.99472899095144263, 0.078314941019622886, 0.44206845606243961, 0.30857433265707379, 0.048661247184825784, 0.76954870938240083, 0.27253204080482074], 3:[0.687619207224633, 0.81614795840545351, 0.8866348164721 [...] +50 {5:[0.0805668018581458, 0.56751024600175393, 0.086756816058294217], 4:NULL, 2:[0.38665070404516133, 0.27363095817403738, 0.34854625766951086], 0:[0.025456093624682374, 0.43295502354537052, 0.10342370810142731, 0.673986645671262]} {"GyELt5-XM7p3Mp-pUp-Y6TD":{"VvylVT-srxX9Ck-XsN-Yr58":0.92549562290400178, "5gOFaY-uDnHRxk-UPH-we5L":0.24457848181013797, "c6SSkD-kPV8Czr-JqL-DxlE":0.20486363523944195, "x8pe01-Hy1cfS5-4vi-E1kU":0.26844008458047974}} +51 {3:[0.78535062886651474, 0.19530298980291305, 0.82274947966575651, 0.57456358216295356, 0.10599288799846596, 0.39764934489047621, 0.51795746073876048], 7:[0.16070456646011266, 0.21622384654359439, 0.56499626756102206, 0.72436522397859471, 0.82689046273989342, 0.22650887858691748, 0.32479201632413013]} {"4otnat-06sRoIc-KbX-PkSN":{"o23H5u-idPYROb-sw2-BQhg":0.85773612726715764, "iJpcEr-1QxMiLf-8aC-riuH":0.03472786196768185, "tKrDuc-Tj4UVIe-C57-4mbf":0.86687892273671452, "YJZ2UI-2PN7S1W-i [...] +52 {0:[0.62615541893380477, 0.95529554839136432, 0.050730598464887144, 0.761698822315222, 0.80097400922586182, 0.70937695669061984], 5:[0.62829741017499841, 0.99919407074570377, 0.23510344788227955, 0.069021645160855516, 0.6642318482893439, 0.9974935200158882], 6:[0.096952964273770093, 0.23922857266269104, 0.846224571908401, 0.87146585941421051, 0.53052946534784406, 0.6305106935161614], 9:[0.39275946491137603, 0.66377199224436567, 0.077114224016427313, 0.43485635822176161, 0.175692114544 [...] +53 {0:NULL, 4:[0.65266799993546065, 0.11840912909620105]} {"glGz8W-Jzn5yan-qEL-SFgy":{"C4BIKV-aEandHf-xla-LRzW":0.22358537808347978, "GOFbpr-x52KThj-aKy-HV7F":0.83659888142243366, "o1n5KE-DgUY81C-tcC-OL4Q":0.035902339181033582}} +54 {7:[0.59320825804184385, 0.460039302772568, 0.90394502926182008, 0.45976237364292183, 0.54427996873292928], 4:[0.60400955940603684, 0.1179781621960635, 0.054480238266918279, 0.51396478978712468, 0.16301849677559921, 0.93635339321496047], 0:NULL, 5:[0.99554525790228077, 0.94498931565118727, 0.40693028978907797, 0.81030985598971417, 0.799750141732691, 0.18095132253143864]} {"qShR1x-3NrIm5N-O9R-fukB":{"uXEPQj-LuWrGEk-BKS-L9gQ":0.098931042165366967, "dLI446-OUk42lG-6ci-k68f":0.99855144476 [...] +55 {0:[0.06106407334414421, 0.077519447583608181], 8:[0.977318070315718, 0.21828389231565848, 0.43289221013701307, 0.86875555142643635], 2:[0.81063763152261414, 0.20641371630459315, 0.78885531594886116]} {"27r2Ca-AxlNBhg-r7z-SPZ0":{"RxuNhx-wsVMLvT-9hR-PcwI":0.11951614997496263, "FtPDZ4-K9ZvUKU-8Ur-VoVG":0.36999657416815812, "bLdezi-TF11R2v-7lt-wbtY":0.818115150860844, "521V4E-GlCoVaL-Jyf-n5Nw":0.71210133502368567, "onY3wU-XhasJ7a-YlJ-2mlW":0.14628789539110221}} +56 {6:NULL, 0:[0.14265810711006088]} {"JLwX2N-xqTuG6v-Hlf-Ldm2":{"rWb6Kl-fKrn6uu-OrN-FjZI":0.37136010587470325, "WeOIpw-i2XsiCy-9so-uvbU":0.25939055495493146, "1IVUby-DW4NC11-ImH-MCBp":0.82167413145208235, "rImjso-ltgUA0j-HOI-tPrk":0.20831660777224315}} +57 {2:[]} {"IhDLwI-ocNCsSk-iFe-tnYH":{"818ZTI-D2tIL7b-eXZ-es5L":0.62522246291032291, "70sv6h-z7GzsCj-Qbh-kdKi":0.89663028593313043, "MuCpL6-RhL3a1z-u6j-cZ5h":0.836931303563489}} +58 {0:[0.68067777761797, 0.35955837539117619, 0.58946414625791255, 0.7605109448827565, 0.71877033105933363, 0.411403335391371, 0.70213099900915377], 1:[0.54981215293989916, 0.056095646585538672, 0.53041486199861354, 0.62145446215452382, 0.65001103807811489, 0.86164244211406282, 0.611465611565057], 6:[0.19681731890143883, 0.53609201576719812, 0.4813512505819646, 0.38776339288060946, 0.94073108501158786, 0.76104761891050077, 0.64725208219807184], 7:[0.10482812611408332, 0.48028128556853644 [...] +59 {0:[0.9229706867471863, 0.073213375262793812, 0.56932834172049374, 0.87755967293437687, 0.22830035453062369, 0.41194062327361958, 0.07755038754687138], 1:[0.7033499830719242, 0.15080152894131182, 0.67600997025217091, 6.8389054328821253e-05, 0.56251276203337874, 0.57602870310196574, 0.4341019944699861, 0.2833670280022168], 6:[0.64265030086692776, 0.721729336639443, 0.70228317338777235, 0.85521198892310679, 0.19709722556747045, 0.87630691599825172], 7:[0.078627135670950032, 0.8982600399 [...] +60 {2:NULL, 9:[0.68817051068356083, 0.58866705765486893, 0.9770647663621238]} {"2eZZuZ-gPnSceD-I4d-moBg":{"CDuRMK-JH8MfuY-ogq-QiQS":0.061575881523062148, "3WYdO0-XltW1HK-hjM-LNlz":0.86164972492374081, "SxBfEK-pIiMQV6-qwZ-B2rj":0.80341434305286941}} +61 {3:[0.070139380310141552, 0.506328788814395]} {"wRXXT8-84Ukmsm-9Z0-QQDD":{"iThEPc-88gotHW-3D1-Mzwd":0.64810102378016332, "jgiZHL-sQ5oYtk-lHD-syb9":0.76291191407360859}} +62 {9:[0.58994620551878041, 0.18139479750515208, 0.25347123483258072, 0.17111987154863106, 0.26414173446363864, 0.20043217143263392, 0.96164911996602531, 0.65884593534283165], 2:[0.22072083425913747, 0.83821892208162152, 0.67969347796297908, 0.99354319783022, 0.066764795168193447, 0.24733422096006119, 0.8413728913196975, 0.052434404533342693], 7:NULL, 3:[0.988163551682917, 0.13489137067371493, 0.81955620653116534, 0.87247312085219286, 0.16470424817608276, 0.17277816013666891, 0.633896463 [...] +63 {0:[0.07031040534337929, 0.91642829694443262, 0.42182730565188331, 0.39344287833455016, 0.54413120712133223, 0.64299161716796815, 0.62227129307615114], 5:[0.52378173910528536, 0.083159015968547134, 0.90123102014092771, 0.11414082965239369, 0.13673732422864793, 0.896264199789972], 9:NULL, 2:[0.70420519158521711, 0.16762130311811219, 0.92543637480558816, 0.55243625344578728, 0.50436327153092764, 0.36777783134719244], 7:[0.75192736597252685, 0.53671286841638255, 0.18945139793706278, 0.43 [...] +64 {0:NULL, 1:[0.011337485043372064, 0.058960286266133033, 0.0772734354492185, 0.44817124168857858, 0.075220641394569854, 0.8469227637503236, 0.47789453059202847], 9:NULL, 8:[0.96286794729691028, 0.30132565991582017, 0.40461567749408589, 0.64454059875346614, 0.24362602733441763, 0.658068827069971, 0.49295725084987296, 0.88221725574215], 4:[0.089946187244476672, 0.2026907246184031, 0.39235341775543364, 0.1159462120157938, 0.8579443369615477, 0.33975535108683252, 0.5036460914380616, 0.6626 [...] +65 {9:[0.94746404068041457, 0.4867395388849417, 0.40686742056048641, 0.93664324996441717, 0.82497815074271619], 7:NULL, 3:NULL, 8:[0.81824759690610938, 0.80479836141754835, 0.53531597548132892, 0.60036813561764024, 0.11247050474369835, 0.85158863187467182, 0.83383491806156063], 4:[0.61830122794311282, 0.57004917882179, 0.29718449172240657, 0.74453860793269644, 0.53943646049688254, 0.99362849561450006, 0.94952638994277028]} {"9Y25Kk-FTeKyYe-CXr-JUfh":{"nGDwja-Tm8i0At-ImM-izMt":0.979781096 [...] +66 {8:[0.07566122576479517, 0.17372499693102306, 0.83934147737452147, 0.042763224017711932, 0.056944544232054639, 0.66417796747605984, 0.70451120188556149], 4:[0.68524319688266189, 0.39286986935274704, 0.27885508309721962, 0.68519652860132241, 0.50558242548912513, 0.24796144257644304, 0.65049574030345447, 0.43785350251783872], 0:[0.089368313040567249, 0.34125025522474739, 0.44676122153353715, 0.22340149213914762, 0.897182830659752, 0.434185820612778, 0.417426913606436, 0.5545817038159385 [...] +67 {2:NULL, 7:[0.91150902115621757, 0.45059596918526212, 0.33693263304933307, 0.5080615851211272, 0.16511017235132264], 5:[0.28458623602477562, 0.015463155009067808, 0.88518091701252566, 0.19725880943436114, 0.701663575912497, 0.28822203463178708], 3:[0.50857932562343156, 0.43794389999855821, 0.60159902715505187, 0.72004191241526516, 0.91116008640342683, 0.18958726729319353, 0.87370199265374726]} {"dAmin3-xHBtJcE-biY-4f0H":{"d2uRgP-FujFmv4-1Y2-WVIz":0.3515740009388636, "zjY8sk-k5i7dtq-em [...] +68 {5:NULL, 4:[0.88776492865883971, 0.15172448941722771]} {"OSv79P-NAKtGCu-iyi-pPV6":{"d8eb60-hYg0WNF-Fs1-ee1P":0.41997621858538559, "us1TRR-qBtBpyw-Yu3-qZAW":0.8332894211873183}} +69 {6:NULL, 9:[0.020526475919481979, 0.43454245170903083, 0.28669439551470954, 0.75204337758826467, 0.65766593526266148, 0.12150151074992488, 0.16339981205596821, 0.89788901629073115], 2:[0.90048711147861016, 0.4667497643734968, 0.9720865410157381, 0.79242581730160078, 0.16695158265619969, 0.86677266780939122], 3:[0.13462209821494608, 0.38210006325077062, 0.79006030065447685, 0.15166472165405853, 0.581151141639526, 0.38818315992944719, 0.72704482517055635, 0.95370678633722883], 4:[0.0741 [...] +70 {5:NULL, 9:[0.08033091566184658, 0.6062860491776022, 0.96902261094764319, 0.33531531491369793, 0.15421114611317288, 0.95525027438171617, 0.58220748862550331], 2:[0.95923051936525583, 0.99940603203117007, 0.99272399601641514, 0.64675167937166544, 0.0011247984267567235, 0.31355616337391412], 8:[0.33301272307830621, 0.7882504403400048, 0.23685292607925712, 0.73631462477721343, 0.53222169916482176, 0.98412860777863131], 4:[0.41853920705055514, 0.55088467934996677, 0.34225589803839818, 0.9 [...] +71 {9:[0.915160233678902, 0.56218532673784483, 0.022671147471926778], 1:[0.3913504433229803, 0.52307414691003007, 0.49793665693307521, 0.0582947785812834, 0.96119799392692207], 8:NULL, 4:[0.032458360383276652, 0.059237302147171156, 0.50542827372121779]} {"3gAq26-R29c6wX-C0r-lmSu":{"tLP9u3-l2SMVmB-mjG-Jl6w":0.22269082321242084, "Vk3Xgs-p8nevgI-1kh-g2Ln":0.31023019325466172, "VWTV7E-WmoiHa1-Azx-p4uv":0.96594565649777042, "4vCeAM-M09o72Y-MM7-kuq0":0.57476584826863852, "tw99RS-AigR4BN-Cvx-Tt [...] +72 {3:[0.39467746014773986, 0.68089927382163351, 0.17672102367531073, 0.075743536456418625], 1:[0.023318989228810372, 0.76939749383205125, 0.42440547182594346]} {"zDDKlD-skEk2ps-KRo-u1B5":{"iK1yJB-yuEElEZ-li4-vxAT":0.43894802430489277, "4kF6cZ-Cwlf33s-eYD-92Dy":0.97378869646008837, "AyE8nj-ecfHXG1-XuB-ye3B":0.69671634023926254, "CwYJPz-oSaS398-CfV-MOLZ":0.9422562276573786, "xMk5Ob-lCuzA3R-yXs-NLnc":0.31773598018625049}} +73 {2:NULL, 0:NULL, 6:[0.90930407184363815, 0.72654347099786309, 0.77713676166409162, 0.45170100734912888, 0.20561721946523071], 4:[0.55661944239801686, 0.35338583959188696, 0.96078559790357065, 0.9820835035863047]} {"qWb5pY-zDUMBmJ-vWd-t5OQ":{"w0rNjY-66fzAGv-ClT-3wmn":0.53013685341276817, "IO8Vxz-oR7Lf59-vv2-zAh5":0.12968326682140918, "Ogdlby-ZH9sYXd-JdY-ba7O":0.97051029399409849, "oBN81K-JDVgHQA-9Lh-L9BZ":0.013752450408350381, "sUMCB1-rKPSp71-F9O-PyDS":0.7630437343408194, "myAfbD-b27OH [...] +74 {0:NULL, 5:[0.38119307563566651, 0.69249939434627483, 0.38599629448088613, 0.52482148944126283, 0.9523606741851619, 0.76548572122519165], 1:NULL, 7:[0.029714818398116627, 0.55036459290071282, 0.76723075431337873, 0.43448030331230347], 8:[0.20352306482252491, 0.75913355077838607, 0.29383475821077176, 0.89161452923324014, 0.52920363634562007]} {"SwlnEW-OUq8a53-1k3-j9M5":{"RelKZ3-etM12wN-uP4-XR7Z":0.28928123482977663, "FEpfM2-MGtIq1y-Ily-hqLN":0.75982378533995065, "Dy4lap-sNXoyV3-LBz-ikj [...] + +-- !sql -- +0 + diff --git a/regression-test/suites/external_table_p0/tvf/test_local_tvf_with_complex_type_insertinto_doris.groovy b/regression-test/suites/external_table_p0/tvf/test_local_tvf_with_complex_type_insertinto_doris.groovy new file mode 100644 index 0000000000..bcc4526d36 --- /dev/null +++ b/regression-test/suites/external_table_p0/tvf/test_local_tvf_with_complex_type_insertinto_doris.groovy @@ -0,0 +1,79 @@ +// 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. + +// This suit test the `backends` tvf +suite("test_local_tvf_with_complex_type_insertinto_doris", "p0") { + List<List<Object>> table = sql """ select * from backends(); """ + assertTrue(table.size() > 0) + def be_id = table[0][0] + def dataFilePath = context.config.dataPath + "/external_table_p0/tvf/" + def table_name = "comp" + + qt_sql """ADMIN SET FRONTEND CONFIG ('disable_nested_complex_type' = 'false')""" + + // create doris table + qt_sql """ + CREATE TABLE IF NOT EXISTS ${table_name} ( + `id` int(11) NULL, + `m1` MAP<int(11),array<double>> NULL, + `m2` MAP<text,MAP<text,double>> NULL + ) ENGINE=OLAP + DUPLICATE KEY(`id`) + COMMENT 'OLAP' + DISTRIBUTED BY HASH(`id`) BUCKETS 1 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "is_being_synced" = "false", + "storage_format" = "V2", + "light_schema_change" = "true", + "disable_auto_compaction" = "false", + "enable_single_replica_compaction" = "false" + ); """ + + qt_sql """ + select * from local( + "file_path" = "${dataFilePath}/comp.orc", + "backend_id" = "${be_id}", + "format" = "orc");""" + + qt_sql """ + insert into ${table_name} select * from local ( + "file_path" = "${dataFilePath}/comp.orc", + "backend_id" = "${be_id}", + "format" = "orc");""" + + qt_sql """ select * from ${table_name} order by id; """ + + qt_sql """ + select * from local( + "file_path" = "${dataFilePath}/comp.parquet", + "backend_id" = "${be_id}", + "format" = "parquet"); """ + + qt_sql """ + insert into ${table_name} select * from local( + "file_path" = "${dataFilePath}/comp.parquet", + "backend_id" = "${be_id}", + "format" = "parquet"); """ + + qt_sql_count """ select count(*) from ${table_name} """ + + qt_sql """ select * from ${table_name} order by id""" + + qt_sql """ drop table ${table_name} """ + +} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
