Description
Parser will stuck when parsing the sql into ast, eg:
select intType,floatType,stringType,varchar32Type,byteType,shortType,dateType,timestampType,longType , max(intType | 0) from orctest where ((((((((((((((((((((((((((((((((((((((1=2)) and ((1=1))) or (((2=2)) and ((1=2)))) and (((1=1)) or ((0=0)))) or (((1=0)) or ((1=2)))) or (((1=1)) or ((0=0)))) or (((1=1)) and ((0=0)))) or (((2=2)) or ((2=2)))) and (((2=2)) or ((2=2)))) and (((2=2)) or ((1=2)))) or (((0=0)) and ((1=0)))) or (((1=1)) and ((1=2)))) or (((1=1)) and ((2=2)))) or (((1=2)) and ((1=1)))) or (((1=1)) and ((2=2)))) or (((1=1)) or ((1=1)))) and (((0=0)) and ((0=0)))) or (((0=0)) or ((1=2)))) and (((1=2)) and ((1=1)))) and (((0=0)) or ((2=2)))) or (((1=2)) or ((2=2)))) and (((0=0)) and ((1=2)))) or (((1=2)) or ((1=0)))) or (((2=2)) or ((1=0)))) or (((2=2)) or ((1=2)))) or (((1=2)) or ((1=1)))) and (((1=2)) or ((1=2)))) and (((1=0)) or ((2=2)))) and (((2=2)) or ((1=0)))) and (((1=2)) or ((1=1)))) and (((1=2)) or ((1=2)))) and (((2=2)) and ((1=0)))) and (((2=2)) or ((1=1)))) or (((0=0)) and ((1=1)))) and (((2=2)) or ((1=2)))) and (((1=2)) or ((0=0)))) or (((1=0)) and ((1=1)))) or (((1=1)) and ((1=2))) group by intType,floatType,stringType,varchar32Type,byteType,shortType,dateType,timestampType,longType;
The jvm of Server was working fine, with continues minor gc.
The cpu kept 100%.
It means the java logic generated by antlr is too complex.
The way to solve the problem may be optimize the syntax file or update the version of antlr.
Attachments
Issue Links
- duplicates
-
HIVE-15388 HiveParser spends lots of time in parsing queries with lots of "("
- Closed
This might be a dup of
HIVE-15388