commit 2e0e2a999044b0fcdb954b08cae194eae61c2cf9 Author: Daniel Dai Date: Wed Aug 14 03:12:21 2013 +0000 HIVE-5086: Fix scriptfile1.q on Windows diff --git a/build-common.xml b/build-common.xml index ad5ac23..e1e4b9f 100644 --- a/build-common.xml +++ b/build-common.xml @@ -59,7 +59,7 @@ - + diff --git a/ql/src/test/queries/clientpositive/scriptfile1.q b/ql/src/test/queries/clientpositive/scriptfile1.q index 4f65016..a961574 100644 --- a/ql/src/test/queries/clientpositive/scriptfile1.q +++ b/ql/src/test/queries/clientpositive/scriptfile1.q @@ -1,3 +1,5 @@ +-- EXCLUDE_OS_WINDOWS + set hive.input.format=org.apache.hadoop.hive.ql.io.HiveInputFormat; CREATE TABLE dest1(key INT, value STRING); diff --git a/ql/src/test/queries/clientpositive/scriptfile1_win.q b/ql/src/test/queries/clientpositive/scriptfile1_win.q new file mode 100644 index 0000000..0008ae5 --- /dev/null +++ b/ql/src/test/queries/clientpositive/scriptfile1_win.q @@ -0,0 +1,16 @@ +set hive.input.format=org.apache.hadoop.hive.ql.io.HiveInputFormat; +-- INCLUDE_OS_WINDOWS + +CREATE TABLE dest1(key INT, value STRING); + +ADD FILE src/test/scripts/testgrep_win.bat; + +FROM ( + FROM src + SELECT TRANSFORM(src.key, src.value) + USING 'testgrep_win.bat' AS (tkey, tvalue) + CLUSTER BY tkey +) tmap +INSERT OVERWRITE TABLE dest1 SELECT tmap.tkey, tmap.tvalue; + +SELECT dest1.* FROM dest1; diff --git a/ql/src/test/results/clientpositive/scriptfile1_win.q.out b/ql/src/test/results/clientpositive/scriptfile1_win.q.out new file mode 100644 index 0000000..dfaa057 --- /dev/null +++ b/ql/src/test/results/clientpositive/scriptfile1_win.q.out @@ -0,0 +1,54 @@ +PREHOOK: query: -- INCLUDE_OS_WINDOWS + +CREATE TABLE dest1(key INT, value STRING) +PREHOOK: type: CREATETABLE +POSTHOOK: query: -- INCLUDE_OS_WINDOWS + +CREATE TABLE dest1(key INT, value STRING) +POSTHOOK: type: CREATETABLE +POSTHOOK: Output: default@dest1 +PREHOOK: query: FROM ( + FROM src + SELECT TRANSFORM(src.key, src.value) + USING 'testgrep_win.bat' AS (tkey, tvalue) + CLUSTER BY tkey +) tmap +INSERT OVERWRITE TABLE dest1 SELECT tmap.tkey, tmap.tvalue +PREHOOK: type: QUERY +PREHOOK: Input: default@src +PREHOOK: Output: default@dest1 +POSTHOOK: query: FROM ( + FROM src + SELECT TRANSFORM(src.key, src.value) + USING 'testgrep_win.bat' AS (tkey, tvalue) + CLUSTER BY tkey +) tmap +INSERT OVERWRITE TABLE dest1 SELECT tmap.tkey, tmap.tvalue +POSTHOOK: type: QUERY +POSTHOOK: Input: default@src +POSTHOOK: Output: default@dest1 +POSTHOOK: Lineage: dest1.key SCRIPT [(src)src.FieldSchema(name:key, type:string, comment:default), (src)src.FieldSchema(name:value, type:string, comment:default), ] +POSTHOOK: Lineage: dest1.value SCRIPT [(src)src.FieldSchema(name:key, type:string, comment:default), (src)src.FieldSchema(name:value, type:string, comment:default), ] +PREHOOK: query: SELECT dest1.* FROM dest1 +PREHOOK: type: QUERY +PREHOOK: Input: default@dest1 +#### A masked pattern was here #### +POSTHOOK: query: SELECT dest1.* FROM dest1 +POSTHOOK: type: QUERY +POSTHOOK: Input: default@dest1 +#### A masked pattern was here #### +POSTHOOK: Lineage: dest1.key SCRIPT [(src)src.FieldSchema(name:key, type:string, comment:default), (src)src.FieldSchema(name:value, type:string, comment:default), ] +POSTHOOK: Lineage: dest1.value SCRIPT [(src)src.FieldSchema(name:key, type:string, comment:default), (src)src.FieldSchema(name:value, type:string, comment:default), ] +NULL NULL +NULL NULL +10 val_10 +100 val_100 +100 val_100 +103 val_103 +103 val_103 +104 val_104 +104 val_104 +105 val_105 +310 val_310 +NULL NULL +NULL NULL diff --git a/ql/src/test/scripts/testgrep_win.bat b/ql/src/test/scripts/testgrep_win.bat new file mode 100644 index 0000000..9406606 --- /dev/null +++ b/ql/src/test/scripts/testgrep_win.bat @@ -0,0 +1,17 @@ +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, software +@REM distributed under the License is distributed on an "AS IS" BASIS, +@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@REM See the License for the specific language governing permissions and +@REM limitations under the License. + +findstr "10.*"