hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zs...@apache.org
Subject svn commit: r777359 - in /hadoop/hive/trunk: CHANGES.txt ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java ql/src/test/queries/clientpositive/nullscript.q ql/src/test/results/clientpositive/nullscript.q.out
Date Fri, 22 May 2009 02:55:44 GMT
Author: zshao
Date: Fri May 22 02:55:43 2009
New Revision: 777359

URL: http://svn.apache.org/viewvc?rev=777359&view=rev
Log:
HIVE-504. Fix script operator with empty input file. (Raghu Murthy via zshao)

Added:
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/nullscript.q
    hadoop/hive/trunk/ql/src/test/results/clientpositive/nullscript.q.out
Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=777359&r1=777358&r2=777359&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Fri May 22 02:55:43 2009
@@ -150,6 +150,9 @@
 
     HIVE-501. Fix UDFLower() bug. (Zheng Shao via prasadc)
 
+    HIVE-504. Fix script operator with empty input file.
+    (Raghu Murthy via zshao)
+
 Release 0.3.1 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java?rev=777359&r1=777358&r2=777359&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/ScriptOperator.java Fri May
22 02:55:43 2009
@@ -482,7 +482,9 @@
     
     @Override
     public void run() {
-      rp.progress();
+      if (rp != null) {
+        rp.progress();
+      }
     }
   }
 }

Added: hadoop/hive/trunk/ql/src/test/queries/clientpositive/nullscript.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/nullscript.q?rev=777359&view=auto
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/nullscript.q (added)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/nullscript.q Fri May 22 02:55:43
2009
@@ -0,0 +1,10 @@
+DROP TABLE nullscript;
+CREATE TABLE nullscript(KEY STRING, VALUE STRING) STORED AS TEXTFILE;
+LOAD DATA LOCAL INPATH '../data/files/kv1.txt' INTO TABLE nullscript;
+LOAD DATA LOCAL INPATH '../data/files/nullfile.txt' INTO TABLE nullscript;
+explain
+select transform(key) using '/bin/cat' as key1 from nullscript;
+select transform(key) using '/bin/cat' as key1 from nullscript;
+
+
+

Added: hadoop/hive/trunk/ql/src/test/results/clientpositive/nullscript.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/nullscript.q.out?rev=777359&view=auto
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/nullscript.q.out (added)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/nullscript.q.out Fri May 22 02:55:43
2009
@@ -0,0 +1,546 @@
+query: DROP TABLE nullscript
+query: CREATE TABLE nullscript(KEY STRING, VALUE STRING) STORED AS TEXTFILE
+query: LOAD DATA LOCAL INPATH '../data/files/kv1.txt' INTO TABLE nullscript
+query: LOAD DATA LOCAL INPATH '../data/files/nullfile.txt' INTO TABLE nullscript
+query: explain
+select transform(key) using '/bin/cat' as key1 from nullscript
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_TABREF nullscript)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE))
(TOK_SELECT (TOK_SELEXPR (TOK_TRANSFORM (TOK_EXPLIST (TOK_TABLE_OR_COL key)) '/bin/cat' (TOK_ALIASLIST
key1))))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        nullscript 
+            Select Operator
+              expressions:
+                    expr: key
+                    type: string
+              Select Operator
+                expressions:
+                      expr: 0
+                      type: string
+                Transform Operator
+                  command: /bin/cat
+                  output info:
+                      input format: org.apache.hadoop.mapred.TextInputFormat
+                      output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+                  File Output Operator
+                    compressed: false
+                    GlobalTableId: 0
+                    table:
+                        input format: org.apache.hadoop.mapred.TextInputFormat
+                        output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+
+
+query: select transform(key) using '/bin/cat' as key1 from nullscript
+Input: default/nullscript
+Output: /mnt/vol/devrs005.snc1/rmurthy/hadoop_tools/trunk-trunk-apache-hive/ql/../build/ql/tmp/681152477/759590347.10000
+238
+86
+311
+27
+165
+409
+255
+278
+98
+484
+265
+193
+401
+150
+273
+224
+369
+66
+128
+213
+146
+406
+429
+374
+152
+469
+145
+495
+37
+327
+281
+277
+209
+15
+82
+403
+166
+417
+430
+252
+292
+219
+287
+153
+193
+338
+446
+459
+394
+237
+482
+174
+413
+494
+207
+199
+466
+208
+174
+399
+396
+247
+417
+489
+162
+377
+397
+309
+365
+266
+439
+342
+367
+325
+167
+195
+475
+17
+113
+155
+203
+339
+0
+455
+128
+311
+316
+57
+302
+205
+149
+438
+345
+129
+170
+20
+489
+157
+378
+221
+92
+111
+47
+72
+4
+280
+35
+427
+277
+208
+356
+399
+169
+382
+498
+125
+386
+437
+469
+192
+286
+187
+176
+54
+459
+51
+138
+103
+239
+213
+216
+430
+278
+176
+289
+221
+65
+318
+332
+311
+275
+137
+241
+83
+333
+180
+284
+12
+230
+181
+67
+260
+404
+384
+489
+353
+373
+272
+138
+217
+84
+348
+466
+58
+8
+411
+230
+208
+348
+24
+463
+431
+179
+172
+42
+129
+158
+119
+496
+0
+322
+197
+468
+393
+454
+100
+298
+199
+191
+418
+96
+26
+165
+327
+230
+205
+120
+131
+51
+404
+43
+436
+156
+469
+468
+308
+95
+196
+288
+481
+457
+98
+282
+197
+187
+318
+318
+409
+470
+137
+369
+316
+169
+413
+85
+77
+0
+490
+87
+364
+179
+118
+134
+395
+282
+138
+238
+419
+15
+118
+72
+90
+307
+19
+435
+10
+277
+273
+306
+224
+309
+389
+327
+242
+369
+392
+272
+331
+401
+242
+452
+177
+226
+5
+497
+402
+396
+317
+395
+58
+35
+336
+95
+11
+168
+34
+229
+233
+143
+472
+322
+498
+160
+195
+42
+321
+430
+119
+489
+458
+78
+76
+41
+223
+492
+149
+449
+218
+228
+138
+453
+30
+209
+64
+468
+76
+74
+342
+69
+230
+33
+368
+103
+296
+113
+216
+367
+344
+167
+274
+219
+239
+485
+116
+223
+256
+263
+70
+487
+480
+401
+288
+191
+5
+244
+438
+128
+467
+432
+202
+316
+229
+469
+463
+280
+2
+35
+283
+331
+235
+80
+44
+193
+321
+335
+104
+466
+366
+175
+403
+483
+53
+105
+257
+406
+409
+190
+406
+401
+114
+258
+90
+203
+262
+348
+424
+12
+396
+201
+217
+164
+431
+454
+478
+298
+125
+431
+164
+424
+187
+382
+5
+70
+397
+480
+291
+24
+351
+255
+104
+70
+163
+438
+119
+414
+200
+491
+237
+439
+360
+248
+479
+305
+417
+199
+444
+120
+429
+169
+443
+323
+325
+277
+230
+478
+178
+468
+310
+317
+333
+493
+460
+207
+249
+265
+480
+83
+136
+353
+172
+214
+462
+233
+406
+133
+175
+189
+454
+375
+401
+421
+407
+384
+256
+26
+134
+67
+384
+379
+18
+462
+492
+100
+298
+9
+341
+498
+146
+458
+362
+186
+285
+348
+167
+18
+273
+183
+281
+344
+97
+469
+315
+84
+28
+37
+448
+152
+348
+307
+194
+414
+477
+222
+126
+90
+169
+403
+400
+200
+97



Mime
View raw message