Github user mashengchen commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1694#discussion_r243512059
--- 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 --
thank you for the suggestion, aggress with point,1,3,4. for the third one,
the 1GB limit currently is the max fetch size, if a larger value setted , it
may cause mxosrvr core. also the purpose of this PR is to limit the fetch size,
so I don't think it's need to give users the entance to set max fetch
size.(what to do if users set it to 10GB), so i think only when fetch size
larger than 1gb, we may do the limitation, to reduce the size to 1gb
---