diff --git itests/src/test/resources/testconfiguration.properties itests/src/test/resources/testconfiguration.properties index ea288e8..14a6f7b 100644 --- itests/src/test/resources/testconfiguration.properties +++ itests/src/test/resources/testconfiguration.properties @@ -271,7 +271,8 @@ minitez.query.files=bucket_map_join_tez1.q,\ tez_smb_1.q,\ vectorized_dynamic_partition_pruning.q -encrypted.query.files.shared=join_unencrypted_encrypted_tbls.q +encrypted.query.files.shared=join_unencrypted_encrypted_tbls.q\ + join_encrypted_tbls_in_different_length_of_keys.q beeline.positive.exclude=add_part_exist.q,\ alter1.q,\ diff --git ql/src/test/queries/clientpositive/join_encrypted_tbls_in_different_length_of_keys.q ql/src/test/queries/clientpositive/join_encrypted_tbls_in_different_length_of_keys.q new file mode 100644 index 0000000..3044c03 --- /dev/null +++ ql/src/test/queries/clientpositive/join_encrypted_tbls_in_different_length_of_keys.q @@ -0,0 +1,10 @@ +CREATE TABLE encryptedWith128BitsKeyDB.encryptedTableIn128BitsKey(key STRING, value STRING); + +INSERT OVERWRITE TABLE encryptedWith128BitsKeyDB.encryptedTableIn128BitsKey SELECT * FROM src; + +CREATE TABLE encryptedWith256BitsKeyDB.encryptedTableIn256BitsKey(key STRING, value STRING); + +INSERT OVERWRITE TABLE encryptedWith256BitsKeyDB.encryptedTableIn256BitsKey SELECT * FROM src; + +EXPLAIN EXTENDED SELECT * FROM encryptedWith256BitsKeyDB.encryptedTableIn256BitsKey t1 +JOIN encryptedWith128BitsKeyDB.encryptedTableIn128BitsKey t2 WHERE t1.key = t2.key; \ No newline at end of file diff --git ql/src/test/results/clientpositive/encrypted/join_encrypted_tbls_in_different_length_of_keys.q.out ql/src/test/results/clientpositive/encrypted/join_encrypted_tbls_in_different_length_of_keys.q.out new file mode 100644 index 0000000..f521a16 --- /dev/null +++ ql/src/test/results/clientpositive/encrypted/join_encrypted_tbls_in_different_length_of_keys.q.out @@ -0,0 +1,256 @@ +PREHOOK: query: CREATE TABLE encryptedWith128BitsKeyDB.encryptedTableIn128BitsKey(key STRING, value STRING) +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:encryptedwith128bitskeydb +PREHOOK: Output: encryptedWith128BitsKeyDB@encryptedTableIn128BitsKey +POSTHOOK: query: CREATE TABLE encryptedWith128BitsKeyDB.encryptedTableIn128BitsKey(key STRING, value STRING) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:encryptedwith128bitskeydb +POSTHOOK: Output: encryptedWith128BitsKeyDB@encryptedTableIn128BitsKey +PREHOOK: query: INSERT OVERWRITE TABLE encryptedWith128BitsKeyDB.encryptedTableIn128BitsKey SELECT * FROM src +PREHOOK: type: QUERY +PREHOOK: Input: default@src +PREHOOK: Output: encryptedwith128bitskeydb@encryptedtablein128bitskey +POSTHOOK: query: INSERT OVERWRITE TABLE encryptedWith128BitsKeyDB.encryptedTableIn128BitsKey SELECT * FROM src +POSTHOOK: type: QUERY +POSTHOOK: Input: default@src +POSTHOOK: Output: encryptedwith128bitskeydb@encryptedtablein128bitskey +POSTHOOK: Lineage: encryptedtablein128bitskey.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] +POSTHOOK: Lineage: encryptedtablein128bitskey.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] +PREHOOK: query: CREATE TABLE encryptedWith256BitsKeyDB.encryptedTableIn256BitsKey(key STRING, value STRING) +PREHOOK: type: CREATETABLE +PREHOOK: Output: database:encryptedwith256bitskeydb +PREHOOK: Output: encryptedWith256BitsKeyDB@encryptedTableIn256BitsKey +POSTHOOK: query: CREATE TABLE encryptedWith256BitsKeyDB.encryptedTableIn256BitsKey(key STRING, value STRING) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: database:encryptedwith256bitskeydb +POSTHOOK: Output: encryptedWith256BitsKeyDB@encryptedTableIn256BitsKey +PREHOOK: query: INSERT OVERWRITE TABLE encryptedWith256BitsKeyDB.encryptedTableIn256BitsKey SELECT * FROM src +PREHOOK: type: QUERY +PREHOOK: Input: default@src +PREHOOK: Output: encryptedwith256bitskeydb@encryptedtablein256bitskey +POSTHOOK: query: INSERT OVERWRITE TABLE encryptedWith256BitsKeyDB.encryptedTableIn256BitsKey SELECT * FROM src +POSTHOOK: type: QUERY +POSTHOOK: Input: default@src +POSTHOOK: Output: encryptedwith256bitskeydb@encryptedtablein256bitskey +POSTHOOK: Lineage: encryptedtablein256bitskey.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] +POSTHOOK: Lineage: encryptedtablein256bitskey.value SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] +PREHOOK: query: EXPLAIN EXTENDED SELECT * FROM encryptedWith256BitsKeyDB.encryptedTableIn256BitsKey t1 +JOIN encryptedWith128BitsKeyDB.encryptedTableIn128BitsKey t2 WHERE t1.key = t2.key +PREHOOK: type: QUERY +POSTHOOK: query: EXPLAIN EXTENDED SELECT * FROM encryptedWith256BitsKeyDB.encryptedTableIn256BitsKey t1 +JOIN encryptedWith128BitsKeyDB.encryptedTableIn128BitsKey t2 WHERE t1.key = t2.key +POSTHOOK: type: QUERY +ABSTRACT SYNTAX TREE: + +TOK_QUERY + TOK_FROM + TOK_JOIN + TOK_TABREF + TOK_TABNAME + encryptedWith256BitsKeyDB + encryptedTableIn256BitsKey + t1 + TOK_TABREF + TOK_TABNAME + encryptedWith128BitsKeyDB + encryptedTableIn128BitsKey + t2 + TOK_INSERT + TOK_DESTINATION + TOK_DIR + TOK_TMP_FILE + TOK_SELECT + TOK_SELEXPR + TOK_ALLCOLREF + TOK_WHERE + = + . + TOK_TABLE_OR_COL + t1 + key + . + TOK_TABLE_OR_COL + t2 + key + + +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Map Reduce + Map Operator Tree: + TableScan + alias: t2 + Statistics: Num rows: 29 Data size: 5812 Basic stats: COMPLETE Column stats: NONE + GatherStats: false + Filter Operator + isSamplingPred: false + predicate: key is not null (type: boolean) + Statistics: Num rows: 15 Data size: 3006 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: key (type: string) + sort order: + + Map-reduce partition columns: key (type: string) + Statistics: Num rows: 15 Data size: 3006 Basic stats: COMPLETE Column stats: NONE + tag: 1 + value expressions: value (type: string) + auto parallelism: false + TableScan + alias: t1 + Statistics: Num rows: 29 Data size: 5812 Basic stats: COMPLETE Column stats: NONE + GatherStats: false + Filter Operator + isSamplingPred: false + predicate: key is not null (type: boolean) + Statistics: Num rows: 15 Data size: 3006 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: key (type: string) + sort order: + + Map-reduce partition columns: key (type: string) + Statistics: Num rows: 15 Data size: 3006 Basic stats: COMPLETE Column stats: NONE + tag: 0 + value expressions: value (type: string) + auto parallelism: false + Path -> Alias: +#### A masked pattern was here #### + Path -> Partition: +#### A masked pattern was here #### + Partition + base file name: encryptedtablein128bitskey + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + properties: + COLUMN_STATS_ACCURATE true + bucket_count -1 + columns key,value + columns.comments + columns.types string:string +#### A masked pattern was here #### + name encryptedwith128bitskeydb.encryptedtablein128bitskey + numFiles 1 + numRows 0 + rawDataSize 0 + serialization.ddl struct encryptedtablein128bitskey { string key, string value} + serialization.format 1 + serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + totalSize 5812 +#### A masked pattern was here #### + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + properties: + COLUMN_STATS_ACCURATE true + bucket_count -1 + columns key,value + columns.comments + columns.types string:string +#### A masked pattern was here #### + name encryptedwith128bitskeydb.encryptedtablein128bitskey + numFiles 1 + numRows 0 + rawDataSize 0 + serialization.ddl struct encryptedtablein128bitskey { string key, string value} + serialization.format 1 + serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + totalSize 5812 +#### A masked pattern was here #### + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + name: encryptedwith128bitskeydb.encryptedtablein128bitskey + name: encryptedwith128bitskeydb.encryptedtablein128bitskey +#### A masked pattern was here #### + Partition + base file name: encryptedtablein256bitskey + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + properties: + COLUMN_STATS_ACCURATE true + bucket_count -1 + columns key,value + columns.comments + columns.types string:string +#### A masked pattern was here #### + name encryptedwith256bitskeydb.encryptedtablein256bitskey + numFiles 1 + numRows 0 + rawDataSize 0 + serialization.ddl struct encryptedtablein256bitskey { string key, string value} + serialization.format 1 + serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + totalSize 5812 +#### A masked pattern was here #### + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + properties: + COLUMN_STATS_ACCURATE true + bucket_count -1 + columns key,value + columns.comments + columns.types string:string +#### A masked pattern was here #### + name encryptedwith256bitskeydb.encryptedtablein256bitskey + numFiles 1 + numRows 0 + rawDataSize 0 + serialization.ddl struct encryptedtablein256bitskey { string key, string value} + serialization.format 1 + serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + totalSize 5812 +#### A masked pattern was here #### + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + name: encryptedwith256bitskeydb.encryptedtablein256bitskey + name: encryptedwith256bitskeydb.encryptedtablein256bitskey + Truncated Path -> Alias: + /encryptedwith128bitskeydb.db/encryptedtablein128bitskey [t2] + /encryptedwith256bitskeydb.db/encryptedtablein256bitskey [t1] + Needs Tagging: true + Reduce Operator Tree: + Join Operator + condition map: + Inner Join 0 to 1 + condition expressions: + 0 {KEY.reducesinkkey0} {VALUE._col0} + 1 {KEY.reducesinkkey0} {VALUE._col0} + outputColumnNames: _col0, _col1, _col5, _col6 + Statistics: Num rows: 16 Data size: 3306 Basic stats: COMPLETE Column stats: NONE + Filter Operator + isSamplingPred: false + predicate: (_col0 = _col5) (type: boolean) + Statistics: Num rows: 8 Data size: 1653 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: _col0 (type: string), _col1 (type: string), _col5 (type: string), _col6 (type: string) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 8 Data size: 1653 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + GlobalTableId: 0 +#### A masked pattern was here #### + NumFilesPerFileSink: 1 + Statistics: Num rows: 8 Data size: 1653 Basic stats: COMPLETE Column stats: NONE +#### A masked pattern was here #### + table: + input format: org.apache.hadoop.mapred.TextInputFormat + output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat + properties: + columns _col0,_col1,_col2,_col3 + columns.types string:string:string:string + escape.delim \ + hive.serialization.extend.nesting.levels true + serialization.format 1 + serialization.lib org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe + TotalFiles: 1 + GatherStats: false + MultiFileSpray: false + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink +