@Test
  public void testSetFetchSizeZero() throws SQLException {
    final HiveConnection connection = mock(HiveConnection.class);
    final Iface iface = mock(Iface.class);
    final TSessionHandle handle = mock(TSessionHandle.class);

    // No hint specified and no default value passed in through the constructor,
    // so it falls-back to the configuration default value
    int fetchSize = HiveConf.ConfVars.HIVE_SERVER2_THRIFT_RESULTSET_DEFAULT_FETCH_SIZE.defaultIntVal;
    connection.fetchSize = fetchSize;
    try (HiveStatement stmt = new HiveStatement(connection, iface, handle)) {
      stmt.setFetchSize(0);
      assertEquals(fetchSize, stmt.getFetchSize());
    }
  }
Gives the JDBC driver a hint as to the number of rows that should be
fetched from the database when more rows are needed for ResultSet objects
generated by this Statement. If the value specified is zero, then the hint
is ignored. Test for a value of zero (hint is ignored).
jdbc/src/test/org/apache/hive/jdbc/TestHiveStatement.java