Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIVE-27060: Exception in add partitions with SQL Server db when number of parameters in insert query exceed 2100 #4044

Merged
merged 1 commit into from
Feb 10, 2023

Conversation

VenuReddy2103
Copy link
Contributor

@VenuReddy2103 VenuReddy2103 commented Feb 8, 2023

What changes were proposed in this pull request?

In add partitions via direct sql, limiting the number of rows in a single insert query such that total parameters in a query do not exceed 2100 for SQL Server db.

Why are the changes needed?

Add partitions with SQL Server db throws SQLServerException when the number of parameters in the direct sql insert query exceeds 2100.
Exception Stack:
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:258) ~[mssql-jdbc-6.2.1.jre8.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1535) ~[mssql-jdbc-6.2.1.jre8.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:467) ~[mssql-jdbc-6.2.1.jre8.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:409) ~[mssql-jdbc-6.2.1.jre8.jar:?] at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7151) ~[mssql-jdbc-6.2.1.jre8.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2478) ~[mssql-jdbc-6.2.1.jre8.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:219) ~[mssql-jdbc-6.2.1.jre8.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:199) ~[mssql-jdbc-6.2.1.jre8.jar:?] at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:356) ~[mssql-jdbc-6.2.1.jre8.jar:?] at org.apache.hive.com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT] at org.apache.hive.com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java) ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT] at org.datanucleus.store.rdbms.ParamLoggingPreparedStatement.executeUpdate(ParamLoggingPreparedStatement.java:393) ~[datanucleus-rdbms-5.2.10.jar:?] at org.datanucleus.store.rdbms.SQLController.executeStatementUpdate(SQLController.java:435) ~[datanucleus-rdbms-5.2.10.jar:?] at org.datanucleus.store.rdbms.query.SQLQuery.performExecute(SQLQuery.java:622) ~[datanucleus-rdbms-5.2.10.jar:?] at org.datanucleus.store.query.Query.executeQuery(Query.java:1975) ~[datanucleus-core-5.2.10.jar:?] at org.datanucleus.store.rdbms.query.SQLQuery.executeWithArray(SQLQuery.java:818) ~[datanucleus-rdbms-5.2.10.jar:?] at org.datanucleus.api.jdo.JDOQuery.executeInternal(JDOQuery.java:433) ~[datanucleus-api-jdo-5.2.8.jar:?] ... 66 more

Does this PR introduce any user-facing change?

No

How was this patch tested?

Tested with SQL Server

@sonarcloud
Copy link

sonarcloud bot commented Feb 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
No Duplication information No Duplication information

@dengzhhu653 dengzhhu653 merged commit d716d29 into apache:master Feb 10, 2023
yeahyung pushed a commit to yeahyung/hive that referenced this pull request Jul 20, 2023
…f parameters exceed 2100 (Venu Reddy, reviewed by Zhihua Deng)

Closes apache#4044
tarak271 pushed a commit to tarak271/hive-1 that referenced this pull request Dec 19, 2023
…f parameters exceed 2100 (Venu Reddy, reviewed by Zhihua Deng)

Closes apache#4044
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants