[jira] [Updated] (HIVE-11024) Error inserting a date value via parameter marker (PreparedStatement.setDate)
[ https://issues.apache.org/jira/browse/HIVE-11024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sergio Peña updated HIVE-11024: --- Fix Version/s: 1.3.0 > Error inserting a date value via parameter marker (PreparedStatement.setDate) > - > > Key: HIVE-11024 > URL: https://issues.apache.org/jira/browse/HIVE-11024 > Project: Hive > Issue Type: Bug > Components: Hive >Affects Versions: 0.14.0 > Environment: Linux lnxx64r6 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May > 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux >Reporter: Sergio Lob >Assignee: Yongzhi Chen > Fix For: 1.3.0, 2.0.0 > > Attachments: HIVE-11024.1.patch, HIVE-11024.2.patch > > > Inserting a row with a Date parameter marker (PreparedStatement.setDate()) > fails with ParseException: > Exception: org.apache.hive.service.cli.HiveSQLException: Error while > compiling statement: FAILED: ParseException line 1:41 mismatched input '-' > expecting ) near '1980' in statement > org.apache.hive.service.cli.HiveSQLException: Error while compiling > statement: FAILED: ParseException line 1:41 mismatched input '-' expecting ) > near '1980' in statement > at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:231) > at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:217) > at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:254) > at > org.apache.hive.jdbc.HiveStatement.executeUpdate(HiveStatement.java:4 > 06) > at > org.apache.hive.jdbc.HivePreparedStatement.executeUpdate(HivePrepared > Statement.java:117) > at repro1.main(repro1.java:90) > Caused by: org.apache.hive.service.cli.HiveSQLException: Error while > compiling statement: FAILED: ParseException line 1:41 mismatched input '-' > expecting ) near '1980' in statement > at > org.apache.hive.service.cli.operation.Operation.toSQLException(Operat > ion.java:314) > at > org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperati > on.java:102) > at > org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOpe > ration.java:171) > ++ > REPRO: > -- > /* > * It may be freely used, modified, and distributed with no restrictions. > */ > import java.sql.Connection; > import java.sql.DatabaseMetaData; > import java.sql.DriverManager; > import java.sql.ResultSet; > import java.sql.SQLException; > import java.sql.Statement; > import java.sql.PreparedStatement; > import java.sql.ResultSetMetaData; > import java.io.Reader; > /** > */ > public class repro1 > { > /** >* Main method. >* >* @param args >*no arguments required >*/ > public static void main(String [] args) > { > Connection con = null; > Statement stmt = null; > ResultSet rst = null; > String drptab = "DROP TABLE SDLJUNK"; > String crttab = "CREATE TABLE SDLJUNK(I INT, D DATE)"; > String instab = "INSERT INTO TABLE SDLJUNK VALUES (1, ? )"; > try { > System.out.println("="); > System.out.println("Problem description:"); > System.out.println("After setting a value for a DATE parameter marker > "); > System.out.println(" with PreparedStatement.setDate(),"); > System.out.println(" an INSERT statement fails execution with error: > "); > System.out.println(" > "); > System.out.println(" Error while compiling statement: FAILED: "); > System.out.println("ParseException line 1:78 mismatched input '-' "); > System.out.println(" expecting ) near '1980' in statement"); > System.out.println("="); > System.out.println(""); > // Create new instance of JDBC Driver and make connection. > System.out.println("Registering Driver."); > Class.forName("org.apache.hive.jdbc.HiveDriver"); > String url="jdbc:hive2://hwhive:1/R72D"; > System.out.println("Making a connection to: "+url); > con = DriverManager.getConnection(url, "hive", "hive"); > System.out.println("Connection successful.\n"); > DatabaseMetaData dbmd = con.getMetaData(); > System.out.println("getDatabaseProductName() = > "+dbmd.getDatabaseProductName()); > System.out.println("getDatabaseProductVersion() = > "+dbmd.getDatabaseProductVersion()); > System.out.println("getDriverName() = "+dbmd.getDriverName()); > System.out.println("getDriverVersion() = "+dbmd.getDriverVersion()); > try { > System.out.println("con.createStatement()"); > stmt = con.createStatement(); >
[jira] [Updated] (HIVE-11024) Error inserting a date value via parameter marker (PreparedStatement.setDate)
[ https://issues.apache.org/jira/browse/HIVE-11024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sergey Shelukhin updated HIVE-11024: Should this issue be backported to branch-1? It looks like a bug. > Error inserting a date value via parameter marker (PreparedStatement.setDate) > - > > Key: HIVE-11024 > URL: https://issues.apache.org/jira/browse/HIVE-11024 > Project: Hive > Issue Type: Bug > Components: Hive >Affects Versions: 0.14.0 > Environment: Linux lnxx64r6 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May > 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux >Reporter: Sergio Lob >Assignee: Yongzhi Chen > Fix For: 2.0.0 > > Attachments: HIVE-11024.1.patch, HIVE-11024.2.patch > > > Inserting a row with a Date parameter marker (PreparedStatement.setDate()) > fails with ParseException: > Exception: org.apache.hive.service.cli.HiveSQLException: Error while > compiling statement: FAILED: ParseException line 1:41 mismatched input '-' > expecting ) near '1980' in statement > org.apache.hive.service.cli.HiveSQLException: Error while compiling > statement: FAILED: ParseException line 1:41 mismatched input '-' expecting ) > near '1980' in statement > at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:231) > at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:217) > at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:254) > at > org.apache.hive.jdbc.HiveStatement.executeUpdate(HiveStatement.java:4 > 06) > at > org.apache.hive.jdbc.HivePreparedStatement.executeUpdate(HivePrepared > Statement.java:117) > at repro1.main(repro1.java:90) > Caused by: org.apache.hive.service.cli.HiveSQLException: Error while > compiling statement: FAILED: ParseException line 1:41 mismatched input '-' > expecting ) near '1980' in statement > at > org.apache.hive.service.cli.operation.Operation.toSQLException(Operat > ion.java:314) > at > org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperati > on.java:102) > at > org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOpe > ration.java:171) > ++ > REPRO: > -- > /* > * It may be freely used, modified, and distributed with no restrictions. > */ > import java.sql.Connection; > import java.sql.DatabaseMetaData; > import java.sql.DriverManager; > import java.sql.ResultSet; > import java.sql.SQLException; > import java.sql.Statement; > import java.sql.PreparedStatement; > import java.sql.ResultSetMetaData; > import java.io.Reader; > /** > */ > public class repro1 > { > /** >* Main method. >* >* @param args >*no arguments required >*/ > public static void main(String [] args) > { > Connection con = null; > Statement stmt = null; > ResultSet rst = null; > String drptab = "DROP TABLE SDLJUNK"; > String crttab = "CREATE TABLE SDLJUNK(I INT, D DATE)"; > String instab = "INSERT INTO TABLE SDLJUNK VALUES (1, ? )"; > try { > System.out.println("="); > System.out.println("Problem description:"); > System.out.println("After setting a value for a DATE parameter marker > "); > System.out.println(" with PreparedStatement.setDate(),"); > System.out.println(" an INSERT statement fails execution with error: > "); > System.out.println(" > "); > System.out.println(" Error while compiling statement: FAILED: "); > System.out.println("ParseException line 1:78 mismatched input '-' "); > System.out.println(" expecting ) near '1980' in statement"); > System.out.println("="); > System.out.println(""); > // Create new instance of JDBC Driver and make connection. > System.out.println("Registering Driver."); > Class.forName("org.apache.hive.jdbc.HiveDriver"); > String url="jdbc:hive2://hwhive:1/R72D"; > System.out.println("Making a connection to: "+url); > con = DriverManager.getConnection(url, "hive", "hive"); > System.out.println("Connection successful.\n"); > DatabaseMetaData dbmd = con.getMetaData(); > System.out.println("getDatabaseProductName() = > "+dbmd.getDatabaseProductName()); > System.out.println("getDatabaseProductVersion() = > "+dbmd.getDatabaseProductVersion()); > System.out.println("getDriverName() = "+dbmd.getDriverName()); > System.out.println("getDriverVersion() = "+dbmd.getDriverVersion()); > try { > System.out.println("con.createStatement()"); > stmt =
[jira] [Updated] (HIVE-11024) Error inserting a date value via parameter marker (PreparedStatement.setDate)
[ https://issues.apache.org/jira/browse/HIVE-11024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jason Dere updated HIVE-11024: -- Fix Version/s: 2.0.0 Error inserting a date value via parameter marker (PreparedStatement.setDate) - Key: HIVE-11024 URL: https://issues.apache.org/jira/browse/HIVE-11024 Project: Hive Issue Type: Bug Components: Hive Affects Versions: 0.14.0 Environment: Linux lnxx64r6 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux Reporter: Sergio Lob Assignee: Yongzhi Chen Fix For: 2.0.0 Attachments: HIVE-11024.1.patch, HIVE-11024.2.patch Inserting a row with a Date parameter marker (PreparedStatement.setDate()) fails with ParseException: Exception: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:41 mismatched input '-' expecting ) near '1980' in statement org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:41 mismatched input '-' expecting ) near '1980' in statement at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:231) at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:217) at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:254) at org.apache.hive.jdbc.HiveStatement.executeUpdate(HiveStatement.java:4 06) at org.apache.hive.jdbc.HivePreparedStatement.executeUpdate(HivePrepared Statement.java:117) at repro1.main(repro1.java:90) Caused by: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:41 mismatched input '-' expecting ) near '1980' in statement at org.apache.hive.service.cli.operation.Operation.toSQLException(Operat ion.java:314) at org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperati on.java:102) at org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOpe ration.java:171) ++ REPRO: -- /* * It may be freely used, modified, and distributed with no restrictions. */ import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.sql.PreparedStatement; import java.sql.ResultSetMetaData; import java.io.Reader; /** */ public class repro1 { /** * Main method. * * @param args *no arguments required */ public static void main(String [] args) { Connection con = null; Statement stmt = null; ResultSet rst = null; String drptab = DROP TABLE SDLJUNK; String crttab = CREATE TABLE SDLJUNK(I INT, D DATE); String instab = INSERT INTO TABLE SDLJUNK VALUES (1, ? ); try { System.out.println(=); System.out.println(Problem description:); System.out.println(After setting a value for a DATE parameter marker ); System.out.println( with PreparedStatement.setDate(),); System.out.println( an INSERT statement fails execution with error: ); System.out.println( ); System.out.println( Error while compiling statement: FAILED: ); System.out.println(ParseException line 1:78 mismatched input '-' ); System.out.println( expecting ) near '1980' in statement); System.out.println(=); System.out.println(); // Create new instance of JDBC Driver and make connection. System.out.println(Registering Driver.); Class.forName(org.apache.hive.jdbc.HiveDriver); String url=jdbc:hive2://hwhive:1/R72D; System.out.println(Making a connection to: +url); con = DriverManager.getConnection(url, hive, hive); System.out.println(Connection successful.\n); DatabaseMetaData dbmd = con.getMetaData(); System.out.println(getDatabaseProductName() = +dbmd.getDatabaseProductName()); System.out.println(getDatabaseProductVersion() = +dbmd.getDatabaseProductVersion()); System.out.println(getDriverName() = +dbmd.getDriverName()); System.out.println(getDriverVersion() = +dbmd.getDriverVersion()); try { System.out.println(con.createStatement()); stmt = con.createStatement(); System.out.println(drptab); stmt.executeUpdate(drptab); } catch (Exception ex) { System.out.println(Exception: + ex); }
[jira] [Updated] (HIVE-11024) Error inserting a date value via parameter marker (PreparedStatement.setDate)
[ https://issues.apache.org/jira/browse/HIVE-11024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yongzhi Chen updated HIVE-11024: Attachment: HIVE-11024.2.patch Error inserting a date value via parameter marker (PreparedStatement.setDate) - Key: HIVE-11024 URL: https://issues.apache.org/jira/browse/HIVE-11024 Project: Hive Issue Type: Bug Components: Hive Affects Versions: 0.14.0 Environment: Linux lnxx64r6 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux Reporter: Sergio Lob Assignee: Yongzhi Chen Attachments: HIVE-11024.1.patch, HIVE-11024.2.patch Inserting a row with a Date parameter marker (PreparedStatement.setDate()) fails with ParseException: Exception: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:41 mismatched input '-' expecting ) near '1980' in statement org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:41 mismatched input '-' expecting ) near '1980' in statement at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:231) at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:217) at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:254) at org.apache.hive.jdbc.HiveStatement.executeUpdate(HiveStatement.java:4 06) at org.apache.hive.jdbc.HivePreparedStatement.executeUpdate(HivePrepared Statement.java:117) at repro1.main(repro1.java:90) Caused by: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:41 mismatched input '-' expecting ) near '1980' in statement at org.apache.hive.service.cli.operation.Operation.toSQLException(Operat ion.java:314) at org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperati on.java:102) at org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOpe ration.java:171) ++ REPRO: -- /* * It may be freely used, modified, and distributed with no restrictions. */ import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.sql.PreparedStatement; import java.sql.ResultSetMetaData; import java.io.Reader; /** */ public class repro1 { /** * Main method. * * @param args *no arguments required */ public static void main(String [] args) { Connection con = null; Statement stmt = null; ResultSet rst = null; String drptab = DROP TABLE SDLJUNK; String crttab = CREATE TABLE SDLJUNK(I INT, D DATE); String instab = INSERT INTO TABLE SDLJUNK VALUES (1, ? ); try { System.out.println(=); System.out.println(Problem description:); System.out.println(After setting a value for a DATE parameter marker ); System.out.println( with PreparedStatement.setDate(),); System.out.println( an INSERT statement fails execution with error: ); System.out.println( ); System.out.println( Error while compiling statement: FAILED: ); System.out.println(ParseException line 1:78 mismatched input '-' ); System.out.println( expecting ) near '1980' in statement); System.out.println(=); System.out.println(); // Create new instance of JDBC Driver and make connection. System.out.println(Registering Driver.); Class.forName(org.apache.hive.jdbc.HiveDriver); String url=jdbc:hive2://hwhive:1/R72D; System.out.println(Making a connection to: +url); con = DriverManager.getConnection(url, hive, hive); System.out.println(Connection successful.\n); DatabaseMetaData dbmd = con.getMetaData(); System.out.println(getDatabaseProductName() = +dbmd.getDatabaseProductName()); System.out.println(getDatabaseProductVersion() = +dbmd.getDatabaseProductVersion()); System.out.println(getDriverName() = +dbmd.getDriverName()); System.out.println(getDriverVersion() = +dbmd.getDriverVersion()); try { System.out.println(con.createStatement()); stmt = con.createStatement(); System.out.println(drptab); stmt.executeUpdate(drptab); } catch (Exception ex) { System.out.println(Exception: + ex); }
[jira] [Updated] (HIVE-11024) Error inserting a date value via parameter marker (PreparedStatement.setDate)
[ https://issues.apache.org/jira/browse/HIVE-11024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Yongzhi Chen updated HIVE-11024: Attachment: HIVE-11024.1.patch Date value need quoted in query. Error inserting a date value via parameter marker (PreparedStatement.setDate) - Key: HIVE-11024 URL: https://issues.apache.org/jira/browse/HIVE-11024 Project: Hive Issue Type: Bug Components: Hive Affects Versions: 0.14.0 Environment: Linux lnxx64r6 2.6.32-131.0.15.el6.x86_64 #1 SMP Tue May 10 15:42:40 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux Reporter: Sergio Lob Assignee: Yongzhi Chen Attachments: HIVE-11024.1.patch Inserting a row with a Date parameter marker (PreparedStatement.setDate()) fails with ParseException: Exception: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:41 mismatched input '-' expecting ) near '1980' in statement org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:41 mismatched input '-' expecting ) near '1980' in statement at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:231) at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:217) at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:254) at org.apache.hive.jdbc.HiveStatement.executeUpdate(HiveStatement.java:4 06) at org.apache.hive.jdbc.HivePreparedStatement.executeUpdate(HivePrepared Statement.java:117) at repro1.main(repro1.java:90) Caused by: org.apache.hive.service.cli.HiveSQLException: Error while compiling statement: FAILED: ParseException line 1:41 mismatched input '-' expecting ) near '1980' in statement at org.apache.hive.service.cli.operation.Operation.toSQLException(Operat ion.java:314) at org.apache.hive.service.cli.operation.SQLOperation.prepare(SQLOperati on.java:102) at org.apache.hive.service.cli.operation.SQLOperation.runInternal(SQLOpe ration.java:171) ++ REPRO: -- /* * It may be freely used, modified, and distributed with no restrictions. */ import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.sql.PreparedStatement; import java.sql.ResultSetMetaData; import java.io.Reader; /** */ public class repro1 { /** * Main method. * * @param args *no arguments required */ public static void main(String [] args) { Connection con = null; Statement stmt = null; ResultSet rst = null; String drptab = DROP TABLE SDLJUNK; String crttab = CREATE TABLE SDLJUNK(I INT, D DATE); String instab = INSERT INTO TABLE SDLJUNK VALUES (1, ? ); try { System.out.println(=); System.out.println(Problem description:); System.out.println(After setting a value for a DATE parameter marker ); System.out.println( with PreparedStatement.setDate(),); System.out.println( an INSERT statement fails execution with error: ); System.out.println( ); System.out.println( Error while compiling statement: FAILED: ); System.out.println(ParseException line 1:78 mismatched input '-' ); System.out.println( expecting ) near '1980' in statement); System.out.println(=); System.out.println(); // Create new instance of JDBC Driver and make connection. System.out.println(Registering Driver.); Class.forName(org.apache.hive.jdbc.HiveDriver); String url=jdbc:hive2://hwhive:1/R72D; System.out.println(Making a connection to: +url); con = DriverManager.getConnection(url, hive, hive); System.out.println(Connection successful.\n); DatabaseMetaData dbmd = con.getMetaData(); System.out.println(getDatabaseProductName() = +dbmd.getDatabaseProductName()); System.out.println(getDatabaseProductVersion() = +dbmd.getDatabaseProductVersion()); System.out.println(getDriverName() = +dbmd.getDriverName()); System.out.println(getDriverVersion() = +dbmd.getDriverVersion()); try { System.out.println(con.createStatement()); stmt = con.createStatement(); System.out.println(drptab); stmt.executeUpdate(drptab); } catch (Exception ex) { System.out.println(Exception: + ex); }