Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
3.1.0, 4.0.0
-
None
Description
Join query involving table with mask column and other having reserved keyword as column name fails with SemanticException during parsing re-written query :
Original Query :
select a.`date`, b.nm from sample_keyword a join sample_mask b on b.id = a.id;
Re-written Query :
select a.date, b.nm
from sample_keyword a
join (SELECT `id`, CAST(mask_hash(nm) AS string) AS `nm`, BLOCK__OFFSET__INSIDE__FILE, INPUT__FILE__NAME, ROW__ID FROM `default`.`sample_mask` )`b`
on b.id = a.id;
Re-written query does not have escape quotes for date column which cause SemanticException while parsing :
org.apache.hadoop.hive.ql.parse.ParseException: line 1:9 cannot recognize input near 'a' '.' 'date' in selection target at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.rewriteASTWithMaskAndFilter( SemanticAnalyzer.java:12084) at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal( SemanticAnalyzer.java:12298) at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal( CalcitePlanner.java:360) at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze( BaseSemanticAnalyzer.java:289) at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:664) at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1869)
Attachments
Attachments
Issue Links
- Is contained by
-
HIVE-26751 Bug Fixes and Improvements for 3.2.0 release
- Open