[jira] [Updated] (HIVE-21178) COLUMNS_V2[COMMENT] size different between derby db & other dbs.

2019-01-30 Thread Venu Yanamandra (JIRA)


 [ 
https://issues.apache.org/jira/browse/HIVE-21178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Venu Yanamandra updated HIVE-21178:
---
Description: 
Based on the sql scripts present for derby db, the size of COLUMNS_V2[COMMENT] 
is 4000.

[https://github.com/apache/hive/tree/master/metastore/scripts/upgrade/derby]

 

However, if we see those present in say - mysql, we see them limited at 256.

[https://github.com/apache/hive/tree/master/metastore/scripts/upgrade/mysql]

 

For a requirement to store larger amount of comments, non-derby dbs limit the 
maximum size of the column comments.

 

Kindly review the discrepancy. 

 

 

  was:
Based on the sql scripts present for derby db, the size of COLUMNS_V2[COMMENT] 
is 4000.

[https://github.com/apache/hive/tree/master/metastore/scripts/upgrade/derby]

 

However, if we see those present in say - mysql, we see them limited at 256.

[https://github.com/apache/hive/tree/master/metastore/scripts/upgrade/mysql]

 

For a requirement to store larger amount of comments, non-derby dbs, limit the 
maximum size of the column comments.

 

Kindly review the discrepancy. 

 

 


> COLUMNS_V2[COMMENT] size different between derby db & other dbs.
> 
>
> Key: HIVE-21178
> URL: https://issues.apache.org/jira/browse/HIVE-21178
> Project: Hive
>  Issue Type: Bug
>Reporter: Venu Yanamandra
>Priority: Minor
>
> Based on the sql scripts present for derby db, the size of 
> COLUMNS_V2[COMMENT] is 4000.
> [https://github.com/apache/hive/tree/master/metastore/scripts/upgrade/derby]
>  
> However, if we see those present in say - mysql, we see them limited at 256.
> [https://github.com/apache/hive/tree/master/metastore/scripts/upgrade/mysql]
>  
> For a requirement to store larger amount of comments, non-derby dbs limit the 
> maximum size of the column comments.
>  
> Kindly review the discrepancy. 
>  
>  



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


[jira] [Commented] (HIVE-19484) 'IN' & '=' do not behave the same way for Date/Timestamp comparison.

2018-05-09 Thread Venu Yanamandra (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-19484?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16469913#comment-16469913
 ] 

Venu Yanamandra commented on HIVE-19484:


It is - hive-1.1.0

> 'IN' & '=' do not behave the same way for Date/Timestamp comparison.
> 
>
> Key: HIVE-19484
> URL: https://issues.apache.org/jira/browse/HIVE-19484
> Project: Hive
>  Issue Type: Bug
>Reporter: Venu Yanamandra
>Priority: Major
>
> We find that there is a difference in the way '=' operator and 'IN' behave 
> when operating on timestamps.
> The issue could be demonstrated using below -
>i) create table test_table (test_date timestamp);
>   ii) insert into test_table values('2018-01-01');
>  iii) select * from test_table where test_date='2018-01-01'; -- Works
>  iv) select * from test_table where test_date in ('2018-01-01'); -- Fails 
> with error [1]
>   v) However, casting works - 
>select * from test_table where test_date in (cast ('2018-01-01' as 
> timestamp));
> As per url [2], we find no references to limitations when '=' or 'IN' are 
> used.
> As per the url [3], we find that there are implicit type conversions defined. 
> However, '=' operates in a different way than the 'IN' operator.
> We would like to see if 'IN' could be made to behave the same way as '='.
> [1]:
>  Caused by: org.apache.hadoop.hive.ql.exec.UDFArgumentException: The 
> arguments for IN should be the same type! Types are: {timestamp IN (string)}
> [2]:
>  
> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-LogicalOperators
> [3]:
>  
> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-AllowedImplicitConversions



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


[jira] [Updated] (HIVE-18477) White spaces characters in view creation via JDBC cause problems with show create.

2018-01-18 Thread Venu Yanamandra (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-18477?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Venu Yanamandra updated HIVE-18477:
---
Description: 
When view is created via JDBC, white spaces are included in the view creation. 
This is not the same behavior if we use beeline to create the view.

For the JDBC issue, consider the below tables setup.
{code:java}
create table t0 (id int, name string, address string, dob timestamp);
create table t1 (id int, activity string, timedone timestamp);
create table t2 (id int, history string);
{code}
And, the Java code to create the view:
{code:java}
public class ViewCreationThroughJDBC{
public static void main(String[] args) throws SQLException{
try {
Class.forName("org.apache.hive.jdbc.HiveDriver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
System.exit(1);
}
String hostName = null;
try {
InetAddress ipAddress = InetAddress.getLocalHost();
hostName = ipAddress.getHostName();
System.out.println("Current IP: <" + ipAddress + ">");
System.out.println("Hostname is: <" + hostName + ">");

} catch (UnknownHostException e) {
e.printStackTrace();
}

String sql = null;
try {
sql = new String(Files.readAllBytes(Paths.get("view_create.txt")), 
StandardCharsets.UTF_8);
} catch (Exception e) {
e.printStackTrace();
}

Connection conn = DriverManager.getConnection("jdbc:hive2://" + hostName + 
":1/default;", "username", "password");

Statement stmt = conn.createStatement();
System.out.println("Running: " + sql);
//ResultSet res = stmt.executeQuery(sql);
stmt.execute(sql);
try {
//res.close();
stmt.close();
conn.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
{code}
And, the contents of view_create.txt referenced in the above code is as shown 
below:

(Note: Please insert tabs \{at least 4 tabs} before each line below. When I 
used the \\{code\} tag, I think it cleared the tabs. Hence, I request you to 
manually insert spaces in front of each line below.}
{code:java}
create view v0 as
select
 -- get the id from t0 table

a.id
 -- Do not get
 --, any other
 --, details

-- lets gather name address and dob
 ,
 a.name ,
 a.address ,
 a.dob ,
 b.activity ,
 b.timedone
 -- The column name should be timezone and not timedone
 ,
 c.history
 from t0 a, t1 b, t2 c
 where
 a.id = b.id
 and c.id = a.id
{code}
When this code is run and a 'show create table v0' is run from beeline, it 
shows empty lines.

Essentially, when: 'show create table v0' is run from beeline, below is the 
output I see:
{code:java}
+--+--+
| createtab_stmt |
+--+--+
| CREATE VIEW `v0` AS select |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+--+--+
22 rows selected (0.188 seconds){code}

  was:
When view is created via JDBC, white spaces are included in the view creation. 
This is not the same behavior if we use beeline to create the view.

For the JDBC issue, consider the below tables setup.
{code:java}
create table t0 (id int, name string, address string, dob timestamp);
create table t1 (id int, activity string, timedone timestamp);
create table t2 (id int, history string);
{code}
And, the Java code to create the view:
{code:java}
public class ViewCreationThroughJDBC{
public static void main(String[] args) throws SQLException{
try {
Class.forName("org.apache.hive.jdbc.HiveDriver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
System.exit(1);
}
String hostName = null;
try {
InetAddress ipAddress = InetAddress.getLocalHost();
hostName = ipAddress.getHostName();
System.out.println("Current IP: <" + ipAddress + ">");
System.out.println("Hostname is: <" + hostName + ">");

} catch (UnknownHostException e) {
e.printStackTrace();
}

String sql = null;
try {
sql = new String(Files.readAllBytes(Paths.get("view_create.txt")), 
StandardCharsets.UTF_8);
} catch (Exception e) {
e.printStackTrace();
}

Connection conn = DriverManager.getConnection("jdbc:hive2://" + hostName + 
":1/default;", "username", "password");

Statement stmt = conn.createStatement();
System.out.println("Running: " + sql);
//ResultSet res = stmt.executeQuery(sql);
stmt.execute(sql);
try {
//res.close();
stmt.close();
conn.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
{code}
And, the contents of view_create.txt referenced in the above code is as shown 
below:
{code:java}
create view v0 as
select
 -- get the id from t0 table

a.id
 -- Do not get
 --, any other
 --, details

-- lets gather name address and dob
 ,
 a.name ,
 a.address ,
 a.dob ,
 b.activity ,
 b.timedone
 -- The column name should be timezone and not timedone
 ,
 c.history
 from t0 a, t1 b, t2 c
 where
 a.id = b.id
 and c.id = a.id
{code}
When this code is run and a 'show create table v0' is run from beeline, it 
shows empty lines.

Essentially, when: 'show create table v0' is run from beeline, below is the 

[jira] [Updated] (HIVE-18477) White spaces characters in view creation via JDBC cause problems with show create.

2018-01-17 Thread Venu Yanamandra (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-18477?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Venu Yanamandra updated HIVE-18477:
---
Description: 
When view is created via JDBC, white spaces are included in the view creation. 
This is not the same behavior if we use beeline to create the view.

For the JDBC issue, consider the below tables setup.
{code:java}
create table t0 (id int, name string, address string, dob timestamp);
create table t1 (id int, activity string, timedone timestamp);
create table t2 (id int, history string);
{code}
And, the Java code to create the view:
{code:java}
public class ViewCreationThroughJDBC{
public static void main(String[] args) throws SQLException{
try {
Class.forName("org.apache.hive.jdbc.HiveDriver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
System.exit(1);
}
String hostName = null;
try {
InetAddress ipAddress = InetAddress.getLocalHost();
hostName = ipAddress.getHostName();
System.out.println("Current IP: <" + ipAddress + ">");
System.out.println("Hostname is: <" + hostName + ">");

} catch (UnknownHostException e) {
e.printStackTrace();
}

String sql = null;
try {
sql = new String(Files.readAllBytes(Paths.get("view_create.txt")), 
StandardCharsets.UTF_8);
} catch (Exception e) {
e.printStackTrace();
}

Connection conn = DriverManager.getConnection("jdbc:hive2://" + hostName + 
":1/default;", "username", "password");

Statement stmt = conn.createStatement();
System.out.println("Running: " + sql);
//ResultSet res = stmt.executeQuery(sql);
stmt.execute(sql);
try {
//res.close();
stmt.close();
conn.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
{code}
And, the contents of view_create.txt referenced in the above code is as shown 
below:
{code:java}
create view v0 as
select
 -- get the id from t0 table

a.id
 -- Do not get
 --, any other
 --, details

-- lets gather name address and dob
 ,
 a.name ,
 a.address ,
 a.dob ,
 b.activity ,
 b.timedone
 -- The column name should be timezone and not timedone
 ,
 c.history
 from t0 a, t1 b, t2 c
 where
 a.id = b.id
 and c.id = a.id
{code}
When this code is run and a 'show create table v0' is run from beeline, it 
shows empty lines.

Essentially, when: 'show create table v0' is run from beeline, below is the 
output I see:
{code:java}
+--+--+
| createtab_stmt |
+--+--+
| CREATE VIEW `v0` AS select |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+--+--+
22 rows selected (0.188 seconds){code}

  was:
When view is created via JDBC, white spaces are included in the view creation. 
This is not the same behavior if we use beeline to create the view.

For the JDBC issue, consider the below tables setup.

{code}
create table t0 (id int, name string, address string, dob timestamp);
create table t1 (id int, activity string, timedone timestamp);
create table t2 (id int, history string);
{code}

And, the Java code to create the view:
{code}
public class ViewCreationThroughJDBC{
public static void main(String[] args) throws SQLException{
try {
Class.forName("org.apache.hive.jdbc.HiveDriver");
} catch (ClassNotFoundException e) {
e.printStackTrace();
System.exit(1);
}
String hostName = null;
try {
InetAddress ipAddress = InetAddress.getLocalHost();
hostName = ipAddress.getHostName();
System.out.println("Current IP: <" + ipAddress + ">");
System.out.println("Hostname is: <" + hostName + ">");

} catch (UnknownHostException e) {
e.printStackTrace();
}

String sql = null;
try {
sql = new String(Files.readAllBytes(Paths.get("view_create.txt")), 
StandardCharsets.UTF_8);
} catch (Exception e) {
e.printStackTrace();
}

Connection conn = DriverManager.getConnection("jdbc:hive2://" + hostName + 
":1/default;", "username", "password");

Statement stmt = conn.createStatement();
System.out.println("Running: " + sql);
//ResultSet res = stmt.executeQuery(sql);
stmt.execute(sql);
try {
//res.close();
stmt.close();
conn.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
}
{code}

And, the contents of view_create.txt referenced in the above code is as shown 
below:

{code}
create view v0 as
select
 -- get the id from t0 table

a.id
 -- Do not get
 --, any other
 --, details

-- lets gather name address and dob
 ,
 a.name ,
 a.address ,
 a.dob ,
 b.activity ,
 b.timedone
 -- The column name should be timezone and not timedone
 ,
 c.history
 from t0 a, t1 b, t2 c
 where
 a.id = b.id
 and c.id = a.id
{code}

When this code is run and a 'show create table v0' is run from beeline, it 
shows empty lines.


> White spaces characters in view creation via JDBC cause problems with show 
> create.
> --
>
> Key: HIVE-18477
> URL: https://issues.apache.org/jira/browse/HIVE-18477
>