[
https://issues.apache.org/jira/browse/HIVE-12971?focusedWorklogId=280845&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-280845
]
ASF GitHub Bot logged work on HIVE-12971:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 23/Jul/19 06:56
Start Date: 23/Jul/19 06:56
Worklog Time Spent: 10m
Work Description: jcamachor commented on pull request #733: HIVE-12971:
Add Support for Kudu Tables
URL: https://github.com/apache/hive/pull/733#discussion_r306152211
##########
File path: kudu-handler/src/test/queries/positive/kudu_queries.q
##########
@@ -0,0 +1,148 @@
+--! qt:dataset:src
+
+-- Create table specifying columns.
+-- Note: Kudu is the source of truth for schema.
+DROP TABLE IF EXISTS kv_table;
+CREATE EXTERNAL TABLE kv_table(key int, value string)
+STORED BY 'org.apache.hadoop.hive.kudu.KuduStorageHandler'
+TBLPROPERTIES ("kudu.table_name" = "default.kudu_kv");
+
+DESCRIBE EXTENDED kv_table;
+
+-- Verify INSERT support.
+INSERT INTO TABLE kv_table VALUES
+(1, "1"), (2, "2");
+
+SELECT * FROM kv_table;
+SELECT count(*) FROM kv_table;
+SELECT count(*) FROM kv_table LIMIT 1;
+SELECT count(1) FROM kv_table;
+
+-- Verify projection and case insensitivity.
+SELECT kEy FROM kv_table;
+
+DROP TABLE kv_table;
+
+-- Create table without specifying columns.
+-- Note: Kudu is the source of truth for schema.
+DROP TABLE IF EXISTS all_types_table;
+CREATE EXTERNAL TABLE all_types_table
+STORED BY 'org.apache.hadoop.hive.kudu.KuduStorageHandler'
+TBLPROPERTIES ("kudu.table_name" = "default.kudu_all_types");
+
+DESCRIBE EXTENDED all_types_table;
+
+INSERT INTO TABLE all_types_table VALUES
+(1, 1, 1, 1, true, 1.1, 1.1, "one", 'one', '2011-11-11 11:11:11', 1.111, null,
1),
+(2, 2, 2, 2, false, 2.2, 2.2, "two", 'two', '2012-12-12 12:12:12', 2.222,
null, 2);
+
+SELECT * FROM all_types_table;
+SELECT count(*) FROM all_types_table;
+
+-- Verify comparison predicates on byte.
+SELECT key FROM all_types_table WHERE key = 1;
+SELECT key FROM all_types_table WHERE key != 1;
+SELECT key FROM all_types_table WHERE key > 1;
+SELECT key FROM all_types_table WHERE key >= 1;
+SELECT key FROM all_types_table WHERE key < 2;
+SELECT key FROM all_types_table WHERE key <= 2;
+
+-- Verify comparison predicates on short.
+SELECT key FROM all_types_table WHERE int16 = 1;
+SELECT key FROM all_types_table WHERE int16 != 1;
+SELECT key FROM all_types_table WHERE int16 > 1;
+SELECT key FROM all_types_table WHERE int16 >= 1;
+SELECT key FROM all_types_table WHERE int16 < 2;
+SELECT key FROM all_types_table WHERE int16 <= 2;
+
+-- Verify comparison predicates on int.
+SELECT key FROM all_types_table WHERE int32 = 1;
+SELECT key FROM all_types_table WHERE int32 != 1;
+SELECT key FROM all_types_table WHERE int32 > 1;
+SELECT key FROM all_types_table WHERE int32 >= 1;
+SELECT key FROM all_types_table WHERE int32 < 2;
+SELECT key FROM all_types_table WHERE int32 <= 2;
+
+-- Verify comparison predicates on long.
+SELECT key FROM all_types_table WHERE int64 = 1;
+SELECT key FROM all_types_table WHERE int64 != 1;
+SELECT key FROM all_types_table WHERE int64 > 1;
+SELECT key FROM all_types_table WHERE int64 >= 1;
+SELECT key FROM all_types_table WHERE int64 < 2;
+SELECT key FROM all_types_table WHERE int64 <= 2;
+
+-- Verify comparison predicates on boolean.
+SELECT key FROM all_types_table WHERE bool = true;
+SELECT key FROM all_types_table WHERE bool != true;
+SELECT key FROM all_types_table WHERE bool > true;
+SELECT key FROM all_types_table WHERE bool >= true;
+SELECT key FROM all_types_table WHERE bool < false;
+SELECT key FROM all_types_table WHERE bool <= false;
+
+-- Verify comparison predicates on string.
+-- Note: string is escaped because it's a reserved word.
+SELECT key FROM all_types_table WHERE `string` = "one";
+SELECT key FROM all_types_table WHERE `string` != "one";
+SELECT key FROM all_types_table WHERE `string` > "one";
+SELECT key FROM all_types_table WHERE `string` >= "one";
+SELECT key FROM all_types_table WHERE `string` < "two";
+SELECT key FROM all_types_table WHERE `string` <= "two";
+
+-- Verify comparison predicates on binary.
+-- Note: binary is escaped because it's a reserved word.
+SELECT key FROM all_types_table WHERE `binary` = cast ('one' as binary);
+SELECT key FROM all_types_table WHERE `binary` != cast ('one' as binary);
+SELECT key FROM all_types_table WHERE `binary` > cast ('one' as binary);
+SELECT key FROM all_types_table WHERE `binary` >= cast ('one' as binary);
+SELECT key FROM all_types_table WHERE `binary` < cast ('two' as binary);
+SELECT key FROM all_types_table WHERE `binary` <= cast ('two' as binary);
+
+-- Verify comparison predicates on timestamp.
+-- Note: timestamp is escaped because it's a reserved word.
+SELECT key FROM all_types_table WHERE `timestamp` = '2011-11-11 11:11:11';
+SELECT key FROM all_types_table WHERE `timestamp` != '2011-11-11 11:11:11';
+SELECT key FROM all_types_table WHERE `timestamp` > '2011-11-11 11:11:11';
+SELECT key FROM all_types_table WHERE `timestamp` >= '2011-11-11 11:11:11';
+SELECT key FROM all_types_table WHERE `timestamp` < '2012-12-12 12:12:12';
+SELECT key FROM all_types_table WHERE `timestamp` <= '2012-12-12 12:12:12';
+
+-- Verify comparison predicates on decimal.
+-- Note: decimal is escaped because it's a reserved word.
+SELECT key FROM all_types_table WHERE `decimal` = 1.111;
+SELECT key FROM all_types_table WHERE `decimal` != 1.111;
+SELECT key FROM all_types_table WHERE `decimal` > 1.111;
+SELECT key FROM all_types_table WHERE `decimal` >= 1.111;
+SELECT key FROM all_types_table WHERE `decimal` < 2.222;
+SELECT key FROM all_types_table WHERE `decimal` <= 2.222;
+
+-- Verify null predicates.
+SELECT key FROM all_types_table WHERE null IS NOT NULL;
+SELECT key FROM all_types_table WHERE null IS NULL;
+
+-- Verify AND predicates.
+SELECT key FROM all_types_table WHERE null IS NULL AND key > 1;
+SELECT key FROM all_types_table WHERE null IS NULL AND key >= 1;
+
+-- Verify OR predicates.
+SELECT key FROM all_types_table WHERE key = 1 OR `string` = "one";
+SELECT key FROM all_types_table WHERE key = 1 OR `string` = "two";
+
+-- Verify various other filters.
+SELECT key FROM all_types_table WHERE string IN ("one", "missing");
+SELECT key FROM all_types_table WHERE string NOT IN ("one", "missing");
+SELECT key FROM all_types_table WHERE key BETWEEN -1 and 1;
+SELECT key FROM all_types_table WHERE `string` LIKE "%n%";
+
Review comment:
Can we add a few more queries to the tests (maybe in a new q file)?
In particular it would be interesting to execute more complex operations on
top of Kudu table so all computation is not pushed to it from Hive (and include
a few explain plans).
Another helpful example would be creating a second table in Hive and try to
join any of the Kudu-backed tables with it (and maybe add some operations on
top, e.g., group by).
In the past we have discovered some bugs with custom storage handlers when
more complex query processing was involved.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 280845)
Time Spent: 2h 10m (was: 2h)
> Hive Support for Kudu
> ---------------------
>
> Key: HIVE-12971
> URL: https://issues.apache.org/jira/browse/HIVE-12971
> Project: Hive
> Issue Type: New Feature
> Affects Versions: 2.0.0
> Reporter: Lenni Kuff
> Assignee: Grant Henke
> Priority: Major
> Labels: pull-request-available
> Attachments: HIVE-12971.0.patch, HIVE-12971.1.patch,
> HIVE-12971.2.patch, HIVE-12971.3.patch
>
> Time Spent: 2h 10m
> Remaining Estimate: 0h
>
> JIRA for tracking work related to Hive/Kudu integration.
> It would be useful to allow Kudu data to be accessible via Hive. This would
> involve creating a Kudu SerDe/StorageHandler and implementing support for
> QUERY and DML commands like SELECT, INSERT, UPDATE, and DELETE. Kudu
> Input/OutputFormats classes already exist. The work can be staged to support
> this functionality incrementally.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)