diff --git ql/src/java/org/apache/hadoop/hive/ql/parse/PTFTranslator.java ql/src/java/org/apache/hadoop/hive/ql/parse/PTFTranslator.java index 018d8d0..9660fa0 100644 --- ql/src/java/org/apache/hadoop/hive/ql/parse/PTFTranslator.java +++ ql/src/java/org/apache/hadoop/hive/ql/parse/PTFTranslator.java @@ -599,7 +599,7 @@ private static void validateValueBoundaryExprType(ObjectInspector OI) if (!OI.getCategory().equals(Category.PRIMITIVE)) { throw new SemanticException( String.format( - "Value Boundary expression must be of primitve type. Found: %s", + "Value Boundary expression must be of primitive type. Found: %s", OI.getTypeName())); } @@ -608,6 +608,7 @@ private static void validateValueBoundaryExprType(ObjectInspector OI) switch (pC) { + case BOOLEAN: case BYTE: case DOUBLE: case FLOAT: @@ -621,7 +622,7 @@ private static void validateValueBoundaryExprType(ObjectInspector OI) break; default: throw new SemanticException( - String.format("Primitve type %s not supported in Value Boundary expression", + String.format("Primitive type %s not supported in Value Boundary expression", pC)); } diff --git ql/src/test/queries/clientpositive/windowing_windowspec5.q ql/src/test/queries/clientpositive/windowing_windowspec5.q new file mode 100644 index 0000000..41efaab --- /dev/null +++ ql/src/test/queries/clientpositive/windowing_windowspec5.q @@ -0,0 +1,8 @@ +create table all100k(t tinyint, si smallint, i int, + b bigint, f float, d double, s string, + dc decimal(38,18), bo boolean, v varchar(25), + c char(25), ts timestamp, dt date); + +select rank() over (partition by i order by bo nulls first, b nulls last range between unbounded preceding and unbounded following), + row_number() over (partition by bo order by si desc, b nulls last range between unbounded preceding and unbounded following) as fv +from all100k order by fv; diff --git ql/src/test/results/clientpositive/windowing_windowspec5.q.out ql/src/test/results/clientpositive/windowing_windowspec5.q.out new file mode 100644 index 0000000..10ab100 --- /dev/null +++ ql/src/test/results/clientpositive/windowing_windowspec5.q.out @@ -0,0 +1,26 @@ +PREHOOK: query: create table all100k(t tinyint, si smallint, i int, + b bigint, f float, d double, s string, + dc decimal(38,18), bo boolean, v varchar(25), + c char(25), ts timestamp, dt date) +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:default +PREHOOK: Output: default@all100k +POSTHOOK: query: create table all100k(t tinyint, si smallint, i int, + b bigint, f float, d double, s string, + dc decimal(38,18), bo boolean, v varchar(25), + c char(25), ts timestamp, dt date) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:default +POSTHOOK: Output: default@all100k +PREHOOK: query: select rank() over (partition by i order by bo nulls first, b nulls last range between unbounded preceding and unbounded following), + row_number() over (partition by bo order by si desc, b nulls last range between unbounded preceding and unbounded following) as fv +from all100k order by fv +PREHOOK: type: QUERY +PREHOOK: Input: default@all100k +#### A masked pattern was here #### +POSTHOOK: query: select rank() over (partition by i order by bo nulls first, b nulls last range between unbounded preceding and unbounded following), + row_number() over (partition by bo order by si desc, b nulls last range between unbounded preceding and unbounded following) as fv +from all100k order by fv +POSTHOOK: type: QUERY +POSTHOOK: Input: default@all100k +#### A masked pattern was here ####