[
https://issues.apache.org/jira/browse/DRILL-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15009173#comment-15009173
]
Rahul Challapalli commented on DRILL-4105:
------------------------------------------
Below is the stack trace for the failure
{code}
2015-11-17 18:13:44,856 [29b491a6-b3a3-1f86-f2d8-a66ec0c1e565:foreman] ERROR
o.a.d.e.p.s.h.DefaultSqlHandler - Node
[rel#485302:Subset#8.PHYSICAL.SINGLETON([]).[]] could not be implemented;
planner state:
Root: rel#485302:Subset#8.PHYSICAL.SINGLETON([]).[]
Original rel:
AbstractConverter(subset=[rel#485302:Subset#8.PHYSICAL.SINGLETON([]).[]],
convention=[PHYSICAL], DrillDistributionTraitDef=[SINGLETON([])], sort=[[]]):
rowcount = 9.0525765625E8, cumulative cost = {inf}, id = 485304
DrillScreenRel(subset=[rel#485301:Subset#8.LOGICAL.ANY([]).[]]): rowcount =
9.0525765625E8, cumulative cost = {9.0525765625E7 rows, 9.0525765625E7 cpu, 0.0
io, 0.0 network, 0.0 memory}, id = 485300
DrillProjectRel(subset=[rel#485299:Subset#7.LOGICAL.ANY([]).[]], *=[$0],
*0=[$2]): rowcount = 9.0525765625E8, cumulative cost = {0.0 rows, 0.0 cpu, 0.0
io, 0.0 network, 0.0 memory}, id = 485298
DrillFilterRel(subset=[rel#485297:Subset#6.LOGICAL.ANY([]).[]],
condition=[CASE(IS NOT NULL($3), =($1, $3), =($1, 'asdf'))]): rowcount =
9.0525765625E8, cumulative cost = {3.621030625E9 rows, 1.8105153125E10 cpu, 0.0
io, 0.0 network, 0.0 memory}, id = 485296
DrillJoinRel(subset=[rel#485295:Subset#5.LOGICAL.ANY([]).[]],
condition=[true], joinType=[inner]): rowcount = 3.621030625E9, cumulative cost
= {3.621030625E9 rows, 1.2035E10 cpu, 0.0 io, 0.0 network, 1.05908E10 memory},
id = 485294
DrillScanRel(subset=[rel#485293:Subset#4.LOGICAL.ANY([]).[]],
table=[[cp, tpch/lineitem.parquet]], groupscan=[ParquetGroupScan
[entries=[ReadEntryWithPath [path=classpath:/tpch/lineitem.parquet]],
selectionRoot=classpath:/tpch/lineitem.parquet, numFiles=1,
usedMetadataFile=false, columns=[`*`]]]): rowcount = 60175.0, cumulative cost =
{60175.0 rows, 6.0175E8 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 485270
DrillScanRel(subset=[rel#485293:Subset#4.LOGICAL.ANY([]).[]],
table=[[cp, tpch/lineitem.parquet]], groupscan=[ParquetGroupScan
[entries=[ReadEntryWithPath [path=classpath:/tpch/lineitem.parquet]],
selectionRoot=classpath:/tpch/lineitem.parquet, numFiles=1,
usedMetadataFile=false, columns=[`*`]]]): rowcount = 60175.0, cumulative cost =
{60175.0 rows, 6.0175E8 cpu, 0.0 io, 0.0 network, 0.0 memory}, id = 485270
Sets:
Set#4, type: (DrillRecordRow[*, l_comment])
rel#485293:Subset#4.LOGICAL.ANY([]).[], best=rel#485270,
importance=0.5904900000000001
rel#485270:DrillScanRel.LOGICAL.ANY([]).[](table=[cp,
tpch/lineitem.parquet],groupscan=ParquetGroupScan [entries=[ReadEntryWithPath
[path=classpath:/tpch/lineitem.parquet]],
selectionRoot=classpath:/tpch/lineitem.parquet, numFiles=1,
usedMetadataFile=false, columns=[`*`]]), rowcount=60175.0, cumulative
cost={60175.0 rows, 6.0175E8 cpu, 0.0 io, 0.0 network, 0.0 memory}
rel#485329:AbstractConverter.LOGICAL.ANY([]).[](input=rel#485328:Subset#4.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
rowcount=60175.0, cumulative cost={inf}
rel#485328:Subset#4.PHYSICAL.SINGLETON([]).[], best=rel#485327,
importance=0.531441
rel#485330:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#485293:Subset#4.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
rowcount=60175.0, cumulative cost={inf}
rel#485327:ScanPrel.PHYSICAL.SINGLETON([]).[](groupscan=ParquetGroupScan
[entries=[ReadEntryWithPath [path=classpath:/tpch/lineitem.parquet]],
selectionRoot=classpath:/tpch/lineitem.parquet, numFiles=1,
usedMetadataFile=false, columns=[`*`]]), rowcount=60175.0, cumulative
cost={60175.0 rows, 120350.0 cpu, 0.0 io, 0.0 network, 0.0 memory}
Set#5, type: RecordType(ANY *, ANY l_comment, ANY *0, ANY l_comment0)
rel#485295:Subset#5.LOGICAL.ANY([]).[], best=rel#485294,
importance=0.6561
rel#485294:DrillJoinRel.LOGICAL.ANY([]).[](left=rel#485293:Subset#4.LOGICAL.ANY([]).[],right=rel#485293:Subset#4.LOGICAL.ANY([]).[],condition=true,joinType=inner),
rowcount=3.621030625E9, cumulative cost={3.621150975E9 rows, 1.32385E10 cpu,
0.0 io, 0.0 network, 1.05908E10 memory}
rel#485323:AbstractConverter.LOGICAL.ANY([]).[](input=rel#485322:Subset#5.PHYSICAL.ANY([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
rowcount=3.621030625E9, cumulative cost={inf}
rel#485322:Subset#5.PHYSICAL.ANY([]).[], best=null,
importance=0.5904900000000001
rel#485324:AbstractConverter.PHYSICAL.ANY([]).[](input=rel#485295:Subset#5.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
rowcount=3.621030625E9, cumulative cost={inf}
Set#6, type: RecordType(ANY *, ANY l_comment, ANY *0, ANY l_comment0)
rel#485297:Subset#6.LOGICAL.ANY([]).[], best=rel#485296,
importance=0.7290000000000001
rel#485296:DrillFilterRel.LOGICAL.ANY([]).[](input=rel#485295:Subset#5.LOGICAL.ANY([]).[],condition=CASE(IS
NOT NULL($3), =($1, $3), =($1, 'asdf'))), rowcount=9.0525765625E8, cumulative
cost={7.2421816E9 rows, 3.1343653125E10 cpu, 0.0 io, 0.0 network, 1.05908E10
memory}
rel#485311:AbstractConverter.LOGICAL.ANY([]).[](input=rel#485310:Subset#6.PHYSICAL.ANY([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
rowcount=9.0525765625E8, cumulative cost={inf}
rel#485310:Subset#6.PHYSICAL.ANY([]).[], best=null, importance=0.6561
rel#485312:AbstractConverter.PHYSICAL.ANY([]).[](input=rel#485297:Subset#6.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
rowcount=9.0525765625E8, cumulative cost={inf}
rel#485325:FilterPrel.PHYSICAL.ANY([]).[](input=rel#485322:Subset#5.PHYSICAL.ANY([]).[],condition=CASE(IS
NOT NULL($3), =($1, $3), =($1, 'asdf'))), rowcount=9.0525765625E8, cumulative
cost={inf}
Set#7, type: RecordType(ANY *, ANY *0)
rel#485299:Subset#7.LOGICAL.ANY([]).[], best=rel#485298, importance=0.81
rel#485298:DrillProjectRel.LOGICAL.ANY([]).[](input=rel#485297:Subset#6.LOGICAL.ANY([]).[],*=$0,*0=$2),
rowcount=9.0525765625E8, cumulative cost={7.242181601E9 rows, 3.1343653126E10
cpu, 0.0 io, 0.0 network, 1.05908E10 memory}
rel#485306:AbstractConverter.LOGICAL.ANY([]).[](input=rel#485305:Subset#7.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
rowcount=9.0525765625E8, cumulative cost={inf}
rel#485315:AbstractConverter.LOGICAL.ANY([]).[](input=rel#485314:Subset#7.PHYSICAL.RANDOM_DISTRIBUTED([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
rowcount=9.0525765625E8, cumulative cost={inf}
rel#485305:Subset#7.PHYSICAL.SINGLETON([]).[], best=null,
importance=0.7290000000000001
rel#485307:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#485299:Subset#7.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
rowcount=9.0525765625E8, cumulative cost={inf}
rel#485316:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#485314:Subset#7.PHYSICAL.RANDOM_DISTRIBUTED([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
rowcount=9.0525765625E8, cumulative cost={inf}
rel#485319:UnionExchangePrel.PHYSICAL.SINGLETON([]).[](input=rel#485314:Subset#7.PHYSICAL.RANDOM_DISTRIBUTED([]).[]),
rowcount=9.0525765625E8, cumulative cost={inf}
rel#485314:Subset#7.PHYSICAL.RANDOM_DISTRIBUTED([]).[], best=null,
importance=0.6561
rel#485317:AbstractConverter.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#485299:Subset#7.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=RANDOM_DISTRIBUTED([]),sort=[]),
rowcount=9.0525765625E8, cumulative cost={inf}
rel#485318:AbstractConverter.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#485305:Subset#7.PHYSICAL.SINGLETON([]).[],convention=PHYSICAL,DrillDistributionTraitDef=RANDOM_DISTRIBUTED([]),sort=[]),
rowcount=9.0525765625E8, cumulative cost={inf}
rel#485313:ProjectPrel.PHYSICAL.RANDOM_DISTRIBUTED([]).[](input=rel#485310:Subset#6.PHYSICAL.ANY([]).[],*=$0,*0=$2),
rowcount=9.0525765625E8, cumulative cost={inf}
Set#8, type: RecordType(ANY *, ANY *0)
rel#485301:Subset#8.LOGICAL.ANY([]).[], best=rel#485300, importance=0.9
rel#485300:DrillScreenRel.LOGICAL.ANY([]).[](input=rel#485299:Subset#7.LOGICAL.ANY([]).[]),
rowcount=9.0525765625E8, cumulative cost={7.332707366625E9 rows,
3.1434178891625E10 cpu, 0.0 io, 0.0 network, 1.05908E10 memory}
rel#485303:AbstractConverter.LOGICAL.ANY([]).[](input=rel#485302:Subset#8.PHYSICAL.SINGLETON([]).[],convention=LOGICAL,DrillDistributionTraitDef=ANY([]),sort=[]),
rowcount=9.0525765625E8, cumulative cost={inf}
rel#485302:Subset#8.PHYSICAL.SINGLETON([]).[], best=null, importance=1.0
rel#485304:AbstractConverter.PHYSICAL.SINGLETON([]).[](input=rel#485301:Subset#8.LOGICAL.ANY([]).[],convention=PHYSICAL,DrillDistributionTraitDef=SINGLETON([]),sort=[]),
rowcount=9.0525765625E8, cumulative cost={inf}
rel#485308:ScreenPrel.PHYSICAL.SINGLETON([]).[](input=rel#485305:Subset#7.PHYSICAL.SINGLETON([]).[]),
rowcount=9.0525765625E8, cumulative cost={inf}
2015-11-17 18:13:44,856 [29b491a6-b3a3-1f86-f2d8-a66ec0c1e565:foreman] INFO
o.a.d.e.planner.sql.DrillSqlWorker - User Error Occurred
org.apache.drill.common.exceptions.UserException: UNSUPPORTED_OPERATION ERROR:
This query cannot be planned possibly due to either a cartesian join or an
inequality join
[Error Id: d0b75ac0-6d39-4fb0-bc48-13e52fa4abf2 ]
at
org.apache.drill.common.exceptions.UserException$Builder.build(UserException.java:534)
~[drill-common-1.4.0-SNAPSHOT.jar:1.4.0-SNAPSHOT]
at
org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:194)
[drill-java-exec-1.4.0-SNAPSHOT.jar:1.4.0-SNAPSHOT]
at org.apache.drill.exec.work.foreman.Foreman.runSQL(Foreman.java:905)
[drill-java-exec-1.4.0-SNAPSHOT.jar:1.4.0-SNAPSHOT]
at org.apache.drill.exec.work.foreman.Foreman.run(Foreman.java:244)
[drill-java-exec-1.4.0-SNAPSHOT.jar:1.4.0-SNAPSHOT]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[na:1.7.0_71]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[na:1.7.0_71]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
Caused by: org.apache.drill.exec.work.foreman.UnsupportedRelOperatorException:
This query cannot be planned possibly due to either a cartesian join or an
inequality join
at
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToPrel(DefaultSqlHandler.java:283)
~[drill-java-exec-1.4.0-SNAPSHOT.jar:1.4.0-SNAPSHOT]
at
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan(DefaultSqlHandler.java:167)
~[drill-java-exec-1.4.0-SNAPSHOT.jar:1.4.0-SNAPSHOT]
at
org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan(DrillSqlWorker.java:184)
[drill-java-exec-1.4.0-SNAPSHOT.jar:1.4.0-SNAPSHOT]
... 5 common frames omitted
{code}
> Constant Folding and coalesce function with 3 parameters gives cannot plan
> exception
> ------------------------------------------------------------------------------------
>
> Key: DRILL-4105
> URL: https://issues.apache.org/jira/browse/DRILL-4105
> Project: Apache Drill
> Issue Type: Bug
> Components: Query Planning & Optimization
> Affects Versions: 1.3.0
> Reporter: Rahul Challapalli
>
> git.commit.id.abbrev=447f8ba
> The below query results in a cannot plan exception
> {code}
> select * from cp.`tpch/lineitem.parquet` d1, cp.`tpch/lineitem.parquet` d2
> where d1.l_comment = coalesce(d2.l_comment, 'asdf', d2.l_comment);
> Error: UNSUPPORTED_OPERATION ERROR: This query cannot be planned possibly due
> to either a cartesian join or an inequality join
> [Error Id: d0b75ac0-6d39-4fb0-bc48-13e52fa4abf2 on qa-node190.qa.lab:31010]
> (state=,code=0)
> {code}
> However the query executes fine if I disabled constant folding.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)