Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> issure about add new columns in table ,but use hive-jdbc can not get these clumns value


Copy link to this message
-
issure about add new columns in table ,but use hive-jdbc can not get these clumns value
hi,maillist:
              i add some new columns to hive table ,but find when i use
beeline, or write my own java code,i can not get these new columns
value,but when i use hive shell,it's ok
0: jdbc:hive2://localhost:10000> desc  test_alex1;
+-----------+------------+----------+
| col_name  | data_type  | comment  |
+-----------+------------+----------+
| id        | string     |          |
| myname    | string     |          |
+-----------+------------+----------+
2 rows selected (0.187 seconds)
0: jdbc:hive2://localhost:10000> alter table test_alex1 add columns (bee
string);
No rows affected (0.239 seconds)
0: jdbc:hive2://localhost:10000> desc
test_alex1;
+-----------+------------+----------+
| col_name  | data_type  | comment  |
+-----------+------------+----------+
| id        | string     |          |
| myname    | string     |          |
| bee       | string     |          |
+-----------+------------+----------+
3 rows selected (0.183 seconds)
0: jdbc:hive2://localhost:10000> select id,myname,bee from test_alex1;
+-------------------------------------------------------------------+----------+
|                                id                                 |
myname   |
+-------------------------------------------------------------------+----------+
| 20501B55B0C64273A5316C5078442569E425CC318ADC454CA163D72503489436  |
1        |
| 20501B55B0C64273A5316C5078442569E3D87D24CA4E42D9A200E391417A7994  |
1        |
| 20501B55B0C64273A5316C5078442569814086424B2942919C97DF1D2D2C1F55  |
1        |
| 205018A818FB43A38CC29FF701E47D8B205018A818FB43A38CC29FF701E47D8B  |
1        |
| 205016D04EDA435CB578D059F931221EB9F06E42815243A486B611B96366DD01  |
1        |
| 205016D04EDA435CB578D059F931221E205016D04EDA435CB578D059F931221E  |
1        |
| 20500D24895641DBBBDBE71640E57887EA06A0AEB4324117B8125FC815297B36  |
1        |
| 205006E8A3EB4CA1997D947D89C5FD1B205006E8A3EB4CA1997D947D89C5FD1B  |
1        |
| 2050054E19B44C4D992D97C1661A26C32050054E19B44C4D992D97C1661A26C3  |
1        |
| 204fa32a43ef4aefac3b391562c5a25b7149D57B47E74C6F8C22CC30292FADF1  |
1        |
+-------------------------------------------------------------------+----------+
10 rows selected (11.679 seconds)
hive (default)> select * from test_alex1;
OK
20501B55B0C64273A5316C5078442569E425CC318ADC454CA163D72503489436
1       1
20501B55B0C64273A5316C5078442569E3D87D24CA4E42D9A200E391417A7994
1       2
20501B55B0C64273A5316C5078442569814086424B2942919C97DF1D2D2C1F55
1       3
205018A818FB43A38CC29FF701E47D8B205018A818FB43A38CC29FF701E47D8B
1       4
205016D04EDA435CB578D059F931221EB9F06E42815243A486B611B96366DD01
1       5
205016D04EDA435CB578D059F931221E205016D04EDA435CB578D059F931221E
1       6
20500D24895641DBBBDBE71640E57887EA06A0AEB4324117B8125FC815297B36
1       7
205006E8A3EB4CA1997D947D89C5FD1B205006E8A3EB4CA1997D947D89C5FD1B
1       8
2050054E19B44C4D992D97C1661A26C32050054E19B44C4D992D97C1661A26C3
1       9
204fa32a43ef4aefac3b391562c5a25b7149D57B47E74C6F8C22CC30292FADF1
1       10
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB