Request perm to edit wiki

2013-06-19 Thread FangKun Cao
Issue HIVE-3682 add a  new feature that user could define custom field
separators and add
serde / output formats support for writing out .
But the usage has not been updated in the following wiki:


https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-Writingdataintofilesystemfromqueries
I‘m glad to do this work and could I get edit permissions?

Thanks.

-- 
Best wishs!
Fangkun.Cao


Review Request: HIVE-4064, Handle db qualified names consistently across all HiveQL statements

2013-06-09 Thread fangkun cao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/11755/
---

Review request for hive.


Description
---

https://issues.apache.org/jira/browse/HIVE-4064


This addresses bug HIVE-4064.
https://issues.apache.org/jira/browse/HIVE-4064


Diffs
-

  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
 1489269 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
 1489269 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g
 1489269 

Diff: https://reviews.apache.org/r/11755/diff/


Testing
---


Thanks,

fangkun cao



Review Request: HIVE-3589, show partition/show tblproperties command should accept database name

2013-06-08 Thread fangkun cao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/11753/
---

Review request for hive and Navis Ryu.


Description
---

https://issues.apache.org/jira/browse/HIVE-3589


This addresses bug HIVE-3589.
https://issues.apache.org/jira/browse/HIVE-3589


Diffs
-

  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
 1489269 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/queries/clientpositive/show_partitions.q
 1489269 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/queries/clientpositive/show_tblproperties.q
 1489269 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/results/clientpositive/show_partitions.q.out
 1489269 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/results/clientpositive/show_tblproperties.q.out
 1489269 

Diff: https://reviews.apache.org/r/11753/diff/


Testing
---

hive (db1) show TBLPROPERTIES  default.srcpart;
OK
 
numPartitions   6
numFiles6
last_modified_bykun.cao
last_modified_time  1369040765
transient_lastDdlTime   1369040765
numRows 3000
totalSize   34872
rawDataSize 31872
Time taken: 0.392 seconds, Fetched: 9 row(s)


hive (db1) show partitions default.srcpart;
OK
ds=2008-04-08/hr=16
ds=2008-04-08/hr=20
ds=2008-04-08/hr=21
ds=2008-04-09/hr=11
ds=2008-04-09/hr=12
ds=2008-05-11/hr=12
ds=2008-12-31/hr=11
ds=2008-12-31/hr=12
Time taken: 0.194 seconds, Fetched: 8 row(s)


Thanks,

fangkun cao



Re: Review Request: when writing data into filesystem from queries , the output files could contain a line of column names

2013-06-07 Thread fangkun cao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10474/
---

(Updated June 7, 2013, 6:36 a.m.)


Review request for hive.


Changes
---

add UT 


Description
---

https://issues.apache.org/jira/browse/HIVE-4346


This addresses bug HIVE-4346.
https://issues.apache.org/jira/browse/HIVE-4346


Diffs (updated)
-

  
http://svn.apache.org/repos/asf/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
 1489269 
  http://svn.apache.org/repos/asf/hive/trunk/conf/hive-default.xml.template 
1489269 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
 1489269 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
 1489269 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadFileDesc.java
 1489269 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/queries/clientpositive/insert_overwrite_local_directory_2.q
 PRE-CREATION 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/results/clientpositive/insert_overwrite_local_directory_2.q.out
 PRE-CREATION 

Diff: https://reviews.apache.org/r/10474/diff/


Testing
---


Thanks,

fangkun cao



Review Request: HIVE-4659 while sql contains \t ? 'desc formatted view_name' and 'show create table view_name' statements will generate Incomplete results

2013-06-05 Thread fangkun cao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/11652/
---

Review request for hive.


Description
---

https://issues.apache.org/jira/browse/HIVE-4659


This addresses bug HIVE-4659.
https://issues.apache.org/jira/browse/HIVE-4659


Diffs
-

  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
 1489269 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/metadata/formatting/MetaDataFormatUtils.java
 1489269 

Diff: https://reviews.apache.org/r/11652/diff/


Testing
---

$ hive -e show create table  v_test_1
CREATE VIEW v_test_1 AS select 
  key,
value, 
dt from 
(
select `tmp_v_t1`.`key`, `tmp_v_t1`.`value`, `tmp_v_t1`.`dt` from 
`default`.`tmp_v_t1` where `tmp_v_t1`.`dt`='20130122' 
union all 
select `tmp_v_t1`.`key`, split(`tmp_v_t1`.`value`,'\\\t')[0] as `value`, 
`tmp_v_t1`.`dt` from `default`.`tmp_v_t1` where `tmp_v_t1`.`dt`='20130123'
) `t` ;


Screenshots
---

Example View 
  https://reviews.apache.org/r/11652/s/27/


Thanks,

fangkun cao



Re: error in running the hive test cases

2013-06-05 Thread FangKun Cao
check if hadoop-test-*.jar is in the classpath


2013/6/4 ur lops urlop...@gmail.com

 Hi,
  When I run the hive test case, I keep getting the following error:
  [echo] Project: serde
 [javac] Compiling 36 source files to
 /home/john/dev/hive-0.9.0-Intel/src/build/serde/test/classes
 [javac] TestAvroSerdeUtils.java:24: cannot find symbol
 [javac] symbol  : class MiniDFSCluster
 [javac] location: package org.apache.hadoop.hdfs
 [javac] import org.apache.hadoop.hdfs.MiniDFSCluster;
 [javac]  ^
 [javac] TestAvroSerdeUtils.java:184: cannot find symbol
 [javac] symbol  : class MiniDFSCluster
 [javac] location: class
 org.apache.hadoop.hive.serde2.avro.TestAvroSerdeUtils
 [javac] MiniDFSCluster miniDfs = null;
 [javac] ^
 [javac] TestAvroSerdeUtils.java:187: cannot find symbol
 [javac] symbol  : class MiniDFSCluster
 [javac] location: class
 org.apache.hadoop.hive.serde2.avro.TestAvroSerdeUtils
 [javac]   miniDfs = new MiniDFSCluster(new Configuration(), 1,
 true, null);
 [javac] ^
 [javac] Note: Some input files use or override a deprecated API.
 [javac] Note: Recompile with -Xlint:deprecation for details.
 [javac] Note: Some input files use unchecked or unsafe operations.
 [javac] Note: Recompile with -Xlint:unchecked for details.

 I am building hive 0.9  and running the test using
 ant package test.
 can someone give me a pointer, which jar is missing from classpath and
 how to resolve it.

 Thanks




-- 
Best wishs!
Fangkun.Cao


Review Request: HIVE-3393 brought in Jackson library, and these four jars should be packed into hive-exec.jar

2013-05-15 Thread fangkun cao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/11173/
---

Review request for hive.


Description
---

https://issues.apache.org/jira/browse/HIVE-4562


This addresses bug HIVE-4562.
https://issues.apache.org/jira/browse/HIVE-4562


Diffs
-

  http://svn.apache.org/repos/asf/hive/trunk/ql/build.xml 1482225 

Diff: https://reviews.apache.org/r/11173/diff/


Testing
---


Thanks,

fangkun cao



Re: Review Request: when writing data into filesystem from queries , the output files could contain a line of column names

2013-05-08 Thread fangkun cao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10474/
---

(Updated May 8, 2013, 6:53 a.m.)


Review request for hive.


Changes
---

User can define separators in _metadata file 


Description
---

https://issues.apache.org/jira/browse/HIVE-4346


This addresses bug HIVE-4346.
https://issues.apache.org/jira/browse/HIVE-4346


Diffs (updated)
-

  
http://svn.apache.org/repos/asf/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
 1480161 
  http://svn.apache.org/repos/asf/hive/trunk/conf/hive-default.xml.template 
1480161 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
 1480161 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
 1480161 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadFileDesc.java
 1480161 

Diff: https://reviews.apache.org/r/10474/diff/


Testing
---


Thanks,

fangkun cao



Review Request: enhance TRUNCATE syntex to drop data of external table

2013-04-18 Thread fangkun cao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10600/
---

Review request for hive.


Description
---

https://issues.apache.org/jira/browse/HIVE-4367


This addresses bug HIVE-4367.
https://issues.apache.org/jira/browse/HIVE-4367


Diffs
-

  
http://svn.apache.org/repos/asf/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
 1468713 
  http://svn.apache.org/repos/asf/hive/trunk/conf/hive-default.xml.template 
1468713 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
 1468713 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
 1468713 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g
 1468713 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
 1468713 

Diff: https://reviews.apache.org/r/10600/diff/


Testing
---

create external table external1 (a int, b int) partitioned by (ds string);
load data local inpath '../data/files/kv1.txt' into table external1 partition 
(ds='2008-04-08');
load data local inpath '../data/files/kv1.txt' into table external1 partition 
(ds='2008-04-09');

-- trucate EXTERNAL table
TRUNCATE TABLE external1 PARTITION (ds='2008-04-08') FORCE;
select * from external1  where ds='2008-04-08'; 
select * from external1  where ds='2008-04-09';

TRUNCATE TABLE external1 FORCE;
select * from external1;


Thanks,

fangkun cao



Re: Review Request: enhance TRUNCATE syntex to drop data of external table

2013-04-18 Thread fangkun cao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10600/
---

(Updated April 18, 2013, 8:19 a.m.)


Review request for hive.


Changes
---

add truncate_table_force.q 
and import org.stringtemplate.v4.ST;


Description
---

https://issues.apache.org/jira/browse/HIVE-4367


This addresses bug HIVE-4367.
https://issues.apache.org/jira/browse/HIVE-4367


Diffs (updated)
-

  
http://svn.apache.org/repos/asf/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
 1469218 
  http://svn.apache.org/repos/asf/hive/trunk/conf/hive-default.xml.template 
1469218 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
 1469218 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
 1469218 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g
 1469218 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
 1469218 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/queries/clientpositive/truncate_table_force.q
 PRE-CREATION 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/results/clientpositive/truncate_table_force.q.out
 PRE-CREATION 

Diff: https://reviews.apache.org/r/10600/diff/


Testing
---

create external table external1 (a int, b int) partitioned by (ds string);
load data local inpath '../data/files/kv1.txt' into table external1 partition 
(ds='2008-04-08');
load data local inpath '../data/files/kv1.txt' into table external1 partition 
(ds='2008-04-09');

-- trucate EXTERNAL table
TRUNCATE TABLE external1 PARTITION (ds='2008-04-08') FORCE;
select * from external1  where ds='2008-04-08'; 
select * from external1  where ds='2008-04-09';

TRUNCATE TABLE external1 FORCE;
select * from external1;


Thanks,

fangkun cao



Review Request: when writing data into filesystem from queries , the output files could contain a line of column names

2013-04-15 Thread fangkun cao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10474/
---

Review request for hive.


Description
---

https://issues.apache.org/jira/browse/HIVE-4346


This addresses bug HIVE-4346.
https://issues.apache.org/jira/browse/HIVE-4346


Diffs
-

  
http://svn.apache.org/repos/asf/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
 1467854 
  http://svn.apache.org/repos/asf/hive/trunk/conf/hive-default.xml.template 
1467854 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
 1467854 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
 1467854 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadFileDesc.java
 1467854 

Diff: https://reviews.apache.org/r/10474/diff/


Testing
---


Thanks,

fangkun cao



Review Request: For partitioned table , if where statement is 'const string equals const string', the query will throw MismatchedTokenException

2013-04-08 Thread fangkun cao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10334/
---

Review request for hive.


Description
---

https://issues.apache.org/jira/browse/HIVE-4307


This addresses bug HIVE-4307.
https://issues.apache.org/jira/browse/HIVE-4307


Diffs
-

  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/ppr/PartitionPruner.java
 1465536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/queries/clientpositive/const_filter.q
 PRE-CREATION 

Diff: https://reviews.apache.org/r/10334/diff/


Testing
---


Thanks,

fangkun cao



Review Request: HIVE-4032:Inserting data into Hive table from a query, when the query is a partitioned table and select * , will generate a SemanticException

2013-04-01 Thread fangkun cao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10234/
---

Review request for hive.


Description
---

See: https://issues.apache.org/jira/browse/HIVE-4032


This addresses bug HIVE-4032.
https://issues.apache.org/jira/browse/HIVE-4032


Diffs
-

  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
 1463367 

Diff: https://reviews.apache.org/r/10234/diff/


Testing
---

Before fix :
hive (default) explain 

   insert into table zr_test partition (dt='20130217') select * 
from zr_test_1 where dt='20130217';
FAILED: SemanticException [Error 10044]: Line 2:18 Cannot insert into target 
table because column number/types are different ''20130217'': Table insclause-0 
has 2 columns, but query has 3 columns.

After fix:
hive (default) explain
   insert into table zr_test partition (dt='20130217') select * 
from zr_test_1 where dt='20130217';
[2013-04-02 12:33:12]: Compile Start 
[2013-04-02 12:33:15]: Compile End
[2013-04-02 12:33:15]: OK
ABSTRACT SYNTAX TREE:
  (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME zr_test_1))) (TOK_INSERT 
(TOK_INSERT_INTO (TOK_TAB (TOK_TABNAME zr_test) (TOK_PARTSPEC (TOK_PARTVAL dt 
'20130217' (TOK_SELECT (TOK_SELEXPR TOK_ALLCOLREF)) (TOK_WHERE (= 
(TOK_TABLE_OR_COL dt) '20130217'

STAGE DEPENDENCIES:
  Stage-1 is a root stage
  Stage-5 depends on stages: Stage-1 , consists of Stage-4, Stage-3
  Stage-4
  Stage-0 depends on stages: Stage-4, Stage-3
  Stage-2 depends on stages: Stage-0
  Stage-3

STAGE PLANS:
  Stage: Stage-1
Map Reduce
  Alias - Map Operator Tree:
zr_test_1 
  TableScan
alias: zr_test_1
Filter Operator
  predicate:
  expr: (dt = '20130217')
  type: boolean
  Select Operator
expressions:
  expr: key
  type: string
  expr: value
  type: string
  expr: dt
  type: string
outputColumnNames: _col0, _col1, _col2
File Output Operator
  compressed: false
  GlobalTableId: 1
  table:
  input format: org.apache.hadoop.mapred.TextInputFormat
  output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
  name: default.zr_test

  Stage: Stage-5
Conditional Operator

  Stage: Stage-4
Move Operator
  files:
  hdfs directory: true
  destination: 
hdfs://hd17-vm5:9101/user/zongren/hive-scratchdir/hive_2013-04-02_12-33-12_425_5386104740729125/-ext-1

  Stage: Stage-0
Move Operator
  tables:
  partition:
dt 20130217
  replace: false
  table:
  input format: org.apache.hadoop.mapred.TextInputFormat
  output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
  name: default.zr_test

  Stage: Stage-2
Stats-Aggr Operator

  Stage: Stage-3
Map Reduce
  Alias - Map Operator Tree:

hdfs://hd17-vm5:9101/user/zongren/hive-scratchdir/hive_2013-04-02_12-33-12_425_5386104740729125/-ext-10002
 
File Output Operator
  compressed: false
  GlobalTableId: 0
  table:
  input format: org.apache.hadoop.mapred.TextInputFormat
  output format: 
org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
  serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
  name: default.zr_test


[2013-04-02 12:33:15]: Time taken: 3.001 seconds


Thanks,

fangkun cao



Review Request: when output hive table to file, users should could have a separator of their own choice

2013-03-25 Thread fangkun cao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10115/
---

Review request for hive.


Description
---

Type: New Feature
Priority: Minor  
Component/s: ql
Problem Definition?when output hive table to file,users should could have a 
separator of their own choice
Design:
Add a new command insert overwrite [local] directory '...' [ROW FORMAT 
row_format] 
Examples :

insert overwrite local directory 
'${system:test.tmp.dir}/hive_test/multiins_local/src'
row format delimited 
FIELDS TERMINATED BY ':' 
LINES TERMINATED BY ','
select * from src ;

create table array_table (a arraystring, b arraystring)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
COLLECTION ITEMS TERMINATED BY ',';

load data local inpath ../data/files/array_table.txt overwrite into table 
array_table;

insert overwrite local directory 
'${system:test.tmp.dir}/hive_test/multiins_local/array_table'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ':'
COLLECTION ITEMS TERMINATED BY '#'
select * from array_table;

CREATE TABLE map_table (foo STRING , bar MAPSTRING, STRING)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
COLLECTION ITEMS TERMINATED BY ','
MAP KEYS TERMINATED BY ':'
STORED AS TEXTFILE;

load data local inpath ../data/files/map_table.txt overwrite into table 
map_table;

insert overwrite local directory 
'${system:test.tmp.dir}/hive_test/multiins_local/map_table'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ':'
COLLECTION ITEMS TERMINATED BY '#'
MAP KEYS TERMINATED BY '='
select * from array_table;

Impact Analysis:
Test ideas?


This addresses bug HIVE-3682.
https://issues.apache.org/jira/browse/HIVE-3682


Diffs
-

  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
 1460536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/QB.java
 1460536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
 1460536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadFileDesc.java
 1460536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/PlanUtils.java
 1460536 

Diff: https://reviews.apache.org/r/10115/diff/


Testing
---


Thanks,

fangkun cao



Re: Review Request: when output hive table to file, users should could have a separator of their own choice

2013-03-25 Thread fangkun cao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10115/
---

(Updated March 25, 2013, 9:32 a.m.)


Review request for hive.


Changes
---

add test .q file


Description
---

Type: New Feature
Priority: Minor  
Component/s: ql
Problem Definition?when output hive table to file,users should could have a 
separator of their own choice
Design:
Add a new command insert overwrite [local] directory '...' [ROW FORMAT 
row_format] 
Examples :

insert overwrite local directory 
'${system:test.tmp.dir}/hive_test/multiins_local/src'
row format delimited 
FIELDS TERMINATED BY ':' 
LINES TERMINATED BY ','
select * from src ;

create table array_table (a arraystring, b arraystring)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
COLLECTION ITEMS TERMINATED BY ',';

load data local inpath ../data/files/array_table.txt overwrite into table 
array_table;

insert overwrite local directory 
'${system:test.tmp.dir}/hive_test/multiins_local/array_table'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ':'
COLLECTION ITEMS TERMINATED BY '#'
select * from array_table;

CREATE TABLE map_table (foo STRING , bar MAPSTRING, STRING)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
COLLECTION ITEMS TERMINATED BY ','
MAP KEYS TERMINATED BY ':'
STORED AS TEXTFILE;

load data local inpath ../data/files/map_table.txt overwrite into table 
map_table;

insert overwrite local directory 
'${system:test.tmp.dir}/hive_test/multiins_local/map_table'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ':'
COLLECTION ITEMS TERMINATED BY '#'
MAP KEYS TERMINATED BY '='
select * from array_table;

Impact Analysis:
Test ideas?


This addresses bug HIVE-3682.
https://issues.apache.org/jira/browse/HIVE-3682


Diffs (updated)
-

  http://svn.apache.org/repos/asf/hive/trunk/data/files/array_table.txt 
PRE-CREATION 
  http://svn.apache.org/repos/asf/hive/trunk/data/files/map_table.txt 
PRE-CREATION 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
 1460536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/QB.java
 1460536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
 1460536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadFileDesc.java
 1460536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/PlanUtils.java
 1460536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/queries/clientpositive/insert_overwrite_local_directory_1.q
 PRE-CREATION 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/results/clientpositive/insert_overwrite_local_directory_1.q.out
 PRE-CREATION 

Diff: https://reviews.apache.org/r/10115/diff/


Testing
---


Thanks,

fangkun cao



Re: Review Request: when output hive table to file, users should could have a separator of their own choice

2013-03-25 Thread fangkun cao

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/10115/
---

(Updated March 25, 2013, 9:35 a.m.)


Review request for hive.


Changes
---

LINES TERMINATED BY ',' is depressed . The default line terminater is \n  and 
should only be \n .


Description (updated)
---

Type: New Feature
Priority: Minor  
Component/s: ql
Problem Definition?when output hive table to file,users should could have a 
separator of their own choice
Design:
Add a new command insert overwrite [local] directory '...' [ROW FORMAT 
row_format] 
Examples :

insert overwrite local directory 
'${system:test.tmp.dir}/hive_test/multiins_local/src'
row format delimited 
FIELDS TERMINATED BY ':' 
select * from src ;

create table array_table (a arraystring, b arraystring)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
COLLECTION ITEMS TERMINATED BY ',';

load data local inpath ../data/files/array_table.txt overwrite into table 
array_table;

insert overwrite local directory 
'${system:test.tmp.dir}/hive_test/multiins_local/array_table'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ':'
COLLECTION ITEMS TERMINATED BY '#'
select * from array_table;

CREATE TABLE map_table (foo STRING , bar MAPSTRING, STRING)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
COLLECTION ITEMS TERMINATED BY ','
MAP KEYS TERMINATED BY ':'
STORED AS TEXTFILE;

load data local inpath ../data/files/map_table.txt overwrite into table 
map_table;

insert overwrite local directory 
'${system:test.tmp.dir}/hive_test/multiins_local/map_table'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ':'
COLLECTION ITEMS TERMINATED BY '#'
MAP KEYS TERMINATED BY '='
select * from array_table;

Impact Analysis:
Test ideas?


This addresses bug HIVE-3682.
https://issues.apache.org/jira/browse/HIVE-3682


Diffs
-

  http://svn.apache.org/repos/asf/hive/trunk/data/files/array_table.txt 
PRE-CREATION 
  http://svn.apache.org/repos/asf/hive/trunk/data/files/map_table.txt 
PRE-CREATION 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g
 1460536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/QB.java
 1460536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
 1460536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/LoadFileDesc.java
 1460536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/PlanUtils.java
 1460536 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/queries/clientpositive/insert_overwrite_local_directory_1.q
 PRE-CREATION 
  
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/results/clientpositive/insert_overwrite_local_directory_1.q.out
 PRE-CREATION 

Diff: https://reviews.apache.org/r/10115/diff/


Testing
---


Thanks,

fangkun cao



Re: [jira] [Commented] (HIVE-3999) Mysql metastore upgrade script will end up with different schema than the full schema load

2013-02-17 Thread FangKun Cao
Hi Jarek Jarcec Cecho,
I agree with you now. Your solution is the most suitable way.




2013/2/18 Jarek Jarcec Cecho (JIRA) j...@apache.org


 [
 https://issues.apache.org/jira/browse/HIVE-3999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13580457#comment-13580457]

 Jarek Jarcec Cecho commented on HIVE-3999:
 --

 Hi sir,
 setting the default value was one of the options that I've explored when
 working on this JIRA. However I've decided not to use it and rather use
 three step column addition (please checkout the patch). One of the reasons
 behind this decision is that with no explicit default value, running old
 hive against new metastore will fail. I believe that this is much safer as
 otherwise Hive would continue to operate on updated schema repository and
 might eventually corrupt the data.

 Jarcec

  Mysql metastore upgrade script will end up with different schema than
 the full schema load
 
 --
 
  Key: HIVE-3999
  URL: https://issues.apache.org/jira/browse/HIVE-3999
  Project: Hive
   Issue Type: Bug
   Components: Metastore
 Reporter: Jarek Jarcec Cecho
 Assignee: Jarek Jarcec Cecho
  Fix For: 0.11.0
 
  Attachments: mysql_upgrade_issue.patch
 
 
  I've noticed that the file {{hive-schema-0.10.0.mysql.sql}} is creating
 table SDS with following column:
  {code}
`IS_STOREDASSUBDIRECTORIES` bit(1) NOT NULL,
  {code}
  However the upgrade script {{011-HIVE-3649.mysql.sql}} will create the
 column differently:
  {code}
  ALTER TABLE `SDS` ADD `IS_STOREDASSUBDIRECTORIES` bit(1) ;
  {code}
  Thus user will get slightly different schema each time - once with NOT
 NULL and secondly with NULL definition.

 --
 This message is automatically generated by JIRA.
 If you think it was sent incorrectly, please contact your JIRA
 administrators
 For more information on JIRA, see: http://www.atlassian.com/software/jira




-- 
Best wishs!
Fangkun.Cao