[ 
https://issues.apache.org/jira/browse/IMPALA-7189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16518796#comment-16518796
 ] 

Xu Zhang commented on IMPALA-7189:
----------------------------------

[~twmarshall]  

_Thanks for your reply , I  already updated this issues 。_ 

 

> Impala save as Kudu, Column Type is TimeStamp ,Time is always eight hours 
> short
> -------------------------------------------------------------------------------
>
>                 Key: IMPALA-7189
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7189
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: Impala 2.11.0
>         Environment: CDH 5.14.2
> HUE 4.0
>            Reporter: Xu Zhang
>            Priority: Major
>         Attachments: image-2018-06-21-09-48-33-924.png
>
>
> Data in Kudu like this:  
> login_time: 1465672268000000     
> user_id : 171734
>  
> login_time eq 2016-06-12 03:11:08
>  
> Select this data in impala : 
> login_time: 2016-06-11 19:11:08
> user_id :  171734
>  
>  
>  
> How did i save the datas : 
> ------------------------------------code 
> start-------------------------------------
> Dataset<Row> 
> consignorRows=sparkSession.createDataFrame(consignorUserActionJavaRDD, 
> ConsignorUserAction.class);
>  
> kuduContext.upsertRows(consignorRows, consignorKuduTableName);
> ----------------------------------------code 
> end---------------------------------
>  
>  
> ConsignorUserAction  has four properties ,include login_time as Timestamp
> I use debug console and trace  to the final step , KuduContext  《
> case DataTypes.TimestampType => operation.getRow.addLong(kuduIdx, 
> KuduRelation.timestampToMicros(row.getTimestamp(sparkIdx)))
> 》 ,Before commit this data,  time  alway right !
>  
> Then,I through kudu client to scan the data:
> --------------------------------------Code 
> start---------------------------------------
> KuduClient client = new 
> KuduClient.KuduClientBuilder("avatartest:7051").build();
> try {
>  KuduTable table = client.openTable("impala::default.consignor_action");
>  List<String> projectColumns = new ArrayList<>(1);
>  projectColumns.add("login_time");
> KuduScanner scanner = client.newScannerBuilder(table)
>  .setProjectedColumnNames(projectColumns)
>  .build();
> while (scanner.hasMoreRows()) {
>  RowResultIterator results = scanner.nextRows();
>  while (results.hasNext()) {
>  RowResult result = results.next();
>  System.out.println(result.getLong(0));
> }
> }
>  
> --------------------------------------Code 
> end---------------------------------------
> I got this: 1465672268000000,That's right  .
>  
>  
> Go on ,  put this query in hue  by impala 。
>  
>  
> !image-2018-06-21-09-48-33-924.png!
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to