FAQ
Author: thejas
Date: Tue Sep 17 20:36:55 2013
New Revision: 1524214

URL: http://svn.apache.org/r1524214
Log:
HIVE-5084 : Fix newline.q on Windows (Daniel Dai via Ashutosh Chauhan)

Modified:
     hive/branches/branch-0.12/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java
     hive/branches/branch-0.12/ql/src/test/queries/clientpositive/newline.q
     hive/branches/branch-0.12/ql/src/test/results/clientpositive/newline.q.out

Modified: hive/branches/branch-0.12/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.12/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java?rev=1524214&r1=1524213&r2=1524214&view=diff
==============================================================================
--- hive/branches/branch-0.12/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java (original)
+++ hive/branches/branch-0.12/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java Tue Sep 17 20:36:55 2013
@@ -212,6 +212,16 @@ public class ScriptOperator extends Oper
            if (f.isFile() && f.canRead()) {
              return f;
            }
+ if (Shell.WINDOWS) {
+ // Try filename with executable extentions
+ String[] exts = new String[] {".exe", ".bat"};
+ for (String ext : exts) {
+ File fileWithExt = new File(f.toString() + ext);
+ if (fileWithExt.isFile() && fileWithExt.canRead()) {
+ return fileWithExt;
+ }
+ }
+ }
          } catch (Exception exp) {
          }
          classvalue = classvalue.substring(val + 1).trim();

Modified: hive/branches/branch-0.12/ql/src/test/queries/clientpositive/newline.q
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.12/ql/src/test/queries/clientpositive/newline.q?rev=1524214&r1=1524213&r2=1524214&view=diff
==============================================================================
--- hive/branches/branch-0.12/ql/src/test/queries/clientpositive/newline.q (original)
+++ hive/branches/branch-0.12/ql/src/test/queries/clientpositive/newline.q Tue Sep 17 20:36:55 2013
@@ -52,6 +52,6 @@ select * from tmp_tmp ORDER BY key ASC,
  SELECT TRANSFORM(key, value) USING
  'cat' AS (key, value) FROM tmp_tmp;

-SELECT key FROM (SELECT TRANSFORM ('a\tb', 'c') USING '/bin/cat' AS (key, value) FROM src limit 1)a ORDER BY key ASC;
+SELECT key FROM (SELECT TRANSFORM ('a\tb', 'c') USING 'cat' AS (key, value) FROM src limit 1)a ORDER BY key ASC;

-SELECT value FROM (SELECT TRANSFORM ('a\tb', 'c') USING '/bin/cat' AS (key, value) FROM src limit 1)a ORDER BY value ASC;
+SELECT value FROM (SELECT TRANSFORM ('a\tb', 'c') USING 'cat' AS (key, value) FROM src limit 1)a ORDER BY value ASC;

Modified: hive/branches/branch-0.12/ql/src/test/results/clientpositive/newline.q.out
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.12/ql/src/test/results/clientpositive/newline.q.out?rev=1524214&r1=1524213&r2=1524214&view=diff
==============================================================================
--- hive/branches/branch-0.12/ql/src/test/results/clientpositive/newline.q.out (original)
+++ hive/branches/branch-0.12/ql/src/test/results/clientpositive/newline.q.out Tue Sep 17 20:36:55 2013
@@ -298,11 +298,11 @@ POSTHOOK: Lineage: tmp_tmp.value SCRIPT
  1\ 2 NULL
  1\\t2 NULL
  1\ 2 NULL
-PREHOOK: query: SELECT key FROM (SELECT TRANSFORM ('a\tb', 'c') USING '/bin/cat' AS (key, value) FROM src limit 1)a ORDER BY key ASC
+PREHOOK: query: SELECT key FROM (SELECT TRANSFORM ('a\tb', 'c') USING 'cat' AS (key, value) FROM src limit 1)a ORDER BY key ASC
  PREHOOK: type: QUERY
  PREHOOK: Input: default@src
  #### A masked pattern was here ####
-POSTHOOK: query: SELECT key FROM (SELECT TRANSFORM ('a\tb', 'c') USING '/bin/cat' AS (key, value) FROM src limit 1)a ORDER BY key ASC
+POSTHOOK: query: SELECT key FROM (SELECT TRANSFORM ('a\tb', 'c') USING 'cat' AS (key, value) FROM src limit 1)a ORDER BY key ASC
  POSTHOOK: type: QUERY
  POSTHOOK: Input: default@src
  #### A masked pattern was here ####
@@ -317,11 +317,11 @@ POSTHOOK: Lineage: tmp_tmp.value SCRIPT
  POSTHOOK: Lineage: tmp_tmp.value SCRIPT [(src)src.FieldSchema(name:key, type:string, comment:default), (src)src.FieldSchema(name:value, type:string, comment:default), ]
  POSTHOOK: Lineage: tmp_tmp.value SCRIPT [(src)src.FieldSchema(name:key, type:string, comment:default), (src)src.FieldSchema(name:value, type:string, comment:default), ]
  a b
-PREHOOK: query: SELECT value FROM (SELECT TRANSFORM ('a\tb', 'c') USING '/bin/cat' AS (key, value) FROM src limit 1)a ORDER BY value ASC
+PREHOOK: query: SELECT value FROM (SELECT TRANSFORM ('a\tb', 'c') USING 'cat' AS (key, value) FROM src limit 1)a ORDER BY value ASC
  PREHOOK: type: QUERY
  PREHOOK: Input: default@src
  #### A masked pattern was here ####
-POSTHOOK: query: SELECT value FROM (SELECT TRANSFORM ('a\tb', 'c') USING '/bin/cat' AS (key, value) FROM src limit 1)a ORDER BY value ASC
+POSTHOOK: query: SELECT value FROM (SELECT TRANSFORM ('a\tb', 'c') USING 'cat' AS (key, value) FROM src limit 1)a ORDER BY value ASC
  POSTHOOK: type: QUERY
  POSTHOOK: Input: default@src
  #### A masked pattern was here ####

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedSep 17, '13 at 8:37p
activeSep 17, '13 at 8:37p
posts1
users1
websitehive.apache.org

1 user in discussion

Thejas: 1 post

People

Translate

site design / logo © 2021 Grokbase