[
https://issues.apache.org/jira/browse/IMPALA-7189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16520036#comment-16520036
]
Xu Zhang commented on IMPALA-7189:
----------------------------------
[~twmarshall]
Thanks!I’ll try as you say 。
I have called _operation and maintenance department ,the product environment
machine‘s timezone is set to CST ._
_Product env and Development env are same ._
_Finally , I try to save this data as int type in impala .I will convert int
to timestamp before i querying them ._
_In this case , i need test it's performance ._
__
> 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, The "login_time" is alway right !
>
> Then,Use Kudu Scan :
> --------------------------------------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 .
>
>
> HUE QUERY PAGE:
>
>
> !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]