Github user mashengchen commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1694#discussion_r243514685
--- Diff:
core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/TrafT4ResultSet.java ---
@@ -2779,6 +2779,19 @@ public boolean next() throws SQLException {
maxRowCnt = maxRows - totalRowsFetched_;
}
+ // if (row width) * (fetch rows) too large, there will have core
in server side.
+ // once fetch bytes bigger than 1GB, devide several times to fetch,
+ // each time fetch bytes less than 1GB.
+ if (outputDesc_ != null && outputDesc_[0] != null) {
+ long rowLength = outputDesc_[0].rowLength_;
+ long oneGB = 1024 * 1024 * 1024;
+ if (rowLength * maxRowCnt >= oneGB) {
+ double multi = (rowLength * maxRowCnt) / (double)oneGB;
+ multi = Math.ceil(multi); // devide several times to fetch
+ maxRowCnt = (int) (maxRowCnt / multi);
+ }
+ }
+
--- End diff --
add note, there may have situations : one time fetch larger than 1GB when
select hive datas or get lob data, at that time mxosrvr will down.
---