What is the difference between Statement.setMaxRows and Statement.setFetchsize in Hive

I am running queries against Hive. The same queries should work with other JDBC drivers, that is, with other relational databases.

I cannot use the Statement.setFetchSize method because it is not supported in Hive JDBC 0.13.0.

I'm trying to work on this, so I came up with another similar method: Statement.setMaxRows

When should I use Statement.setMaxRows vs Statement.setFetchsize?

Can they be used interchangeably?

Thanks.

+4
source share
1 answer

, . . SetMaxRows = , . setFetchSize = , roundtip i.e.

setFetchSize JDBC , , ResultSet, .

setMaxRows ResultSet, Statement, .

, setFetchSize - , , . , Hive JDBC .

, , setMaxRows,

ResultSet. . setMaxRows SQL - top/limit/rownum, . - , . , , , , ResultSet.

, setFetchSize:

JVM JVM , ResultSet.


Btw, setFetchSize java.sql.Statement, java.sql.ResultSet. Statement, . . Hive JDBC HiveQueryResultSet setFetchSize.
+6

Source: https://habr.com/ru/post/1605956/


All Articles