@Test public void testClear() { TableSchema schema = new TableSchema(); schema.addColumn(new Column("col1", OdpsType.BIGINT)); schema.addColumn(new Column("col2", OdpsType.STRING)); ArrayRecord r = new ArrayRecord(schema); r.setBigint(0, 1L); r.setString(1, "hello"); r.clear(); Assert.assertNull("column 0 should be null after clear", r.get(0)); Assert.assertNull("column 1 should be null after clear", r.get(1)); }
public void clear() { for (int i = 0; i < values.length; i++) { values[i] = null; } }
ArrayRecord implements Record { public void clear() { for (int i = 0; i < values.length; i++) { values[i] = null; } } }
ArrayRecord implements Record { public void clear() { for (int i = 0; i < values.length; i++) { values[i] = null; } } ArrayRecord(Column[] columns);  ArrayRecord(Column[] columns, boolean strictTypeValidation);  ArrayRecord(Column[] columns, Object[] values);  ArrayRecord(Column[] columns, Object[] values, boolean strictTypeValidation);  ArrayRecord(TableSchema schema);  ArrayRecord(TableSchema schema, boolean strictTypeValidation); }
ArrayRecord implements Record { public void clear() { for (int i = 0; i < values.length; i++) { values[i] = null; } } ArrayRecord(Column[] columns);  ArrayRecord(Column[] columns, boolean strictTypeValidation);  ArrayRecord(Column[] columns, Object[] values);  ArrayRecord(Column[] columns, Object[] values, boolean strictTypeValidation);  ArrayRecord(TableSchema schema);  ArrayRecord(TableSchema schema, boolean strictTypeValidation); @Override int getColumnCount(); @Override Column[] getColumns(); @Override void set(int idx, Object value); @Override Object get(int idx); @Override void set(String columnName, Object value); @Override Object get(String columnName); @Override void setBigint(int idx, Long value); @Override Long getBigint(int idx); @Override void setBigint(String columnName, Long value); @Override Long getBigint(String columnName); @Override void setDouble(int idx, Double value); @Override Double getDouble(int idx); @Override void setDouble(String columnName, Double value); @Override Double getDouble(String columnName); @Override void setBoolean(int idx, Boolean value); @Override Boolean getBoolean(int idx); @Override void setBoolean(String columnName, Boolean value); @Override Boolean getBoolean(String columnName); @Override void setDatetime(int idx, Date value); @Override Date getDatetime(int idx); @Override void setDatetime(String columnName, Date value); @Override Date getDatetime(String columnName); @Override void setDecimal(int idx, BigDecimal value); @Override BigDecimal getDecimal(int idx); @Override void setDecimal(String columnName, BigDecimal value); @Override BigDecimal getDecimal(String columnName); @Override void setString(int idx, String value); @Override String getString(int idx); @Override void setString(String columnName, String value); @Override String getString(String columnName); @Override void setString(int idx, byte[] value); @Override void setString(String columnName, byte[] value); @Override byte[] getBytes(int idx); @Override byte[] getBytes(String columnName); void setBinary(int idx, Binary value); void setBinary(String columnName, Binary value); Binary getBinary(int idx); Binary getBinary(String columnName); @Override void set(Object[] values); @Override Object[] toArray(); void clear(); void setArray(String columnName, List list); void setArray(int idx, List list); void setMap(int idx, Map map); void setMap(String columnName, Map map); List<T> getArray(Class<T> className, String columnName); List<T> getArray(Class<T> className, int idx); List getArray(String columnName); List getArray(int idx); Map<k, v> getMap(Class<k> keyClass, Class<v> valueClass, String columnName); Map<k, v> getMap(Class<k> keyClass, Class<v> valueClass, int idx); Map getMap(String columnName); Map getMap(int idx); void setChar(int idx, Char value); void setChar(String columnName, Char value); Char getChar(int idx); Char getChar(String columnName); void setVarchar(int idx, Varchar value); void setVarchar(String columnName, Varchar value); Varchar getVarchar(int idx); Varchar getVarchar(String columnName); void setDate(int idx, java.sql.Date value); java.sql.Date getDate(int idx); void setDate(String columnName, java.sql.Date value); java.sql.Date getDate(String columnName); void setTimestamp(int idx, Timestamp value); Timestamp getTimestamp(int idx); void setTimestamp(String columnName, Timestamp value); Timestamp getTimestamp(String columnName); void setFloat(int idx, Float value); void setFloat(String columnName, Float value); Float getFloat(int idx); Float getFloat(String columnName); void setInt(int idx, Integer value); void setInt(String columnName, Integer value); Integer getInt(int idx); Integer getInt(String columnName); void setTinyint(int idx, Byte value); void setTinyint(String columnName, Byte value); Byte getTinyint(int idx); Byte getTinyint(String columnName); void setSmallint(int idx, Short value); void setSmallint(String columnName, Short value); Short getSmallint(int idx); Short getSmallint(String columnName); void setStruct(int idx, Struct value); void setStruct(String columnName, Struct value); Struct getStruct(int idx); Struct getStruct(String columnName); IntervalYearMonth getIntervalYearMonth(int idx); IntervalYearMonth getIntervalYearMonth(String columnName); void setIntervalYearMonth(int idx, IntervalYearMonth value); void setIntervalYearMonth(String columnName, IntervalYearMonth value); IntervalDayTime getIntervalDayTime(int idx); IntervalDayTime getIntervalDayTime(String columnName); void setIntervalDayTime(int idx, IntervalDayTime value); void setIntervalDayTime(String columnName, IntervalDayTime value); @Override boolean isNull(int idx); @Override boolean isNull(String columnName); @Override Record clone(); @SuppressWarnings({"unchecked"}) /** * set record column value directly without type validation * unsafe: caller must ensure correct type and do validation check externally when necessary */ void setWithoutValidation(int idx, Object o); }
ArrayRecord implements Record { public void clear() { for (int i = 0; i < values.length; i++) { values[i] = null; } } ArrayRecord(Column[] columns);  ArrayRecord(Column[] columns, boolean strictTypeValidation);  ArrayRecord(Column[] columns, Object[] values);  ArrayRecord(Column[] columns, Object[] values, boolean strictTypeValidation);  ArrayRecord(TableSchema schema);  ArrayRecord(TableSchema schema, boolean strictTypeValidation); @Override int getColumnCount(); @Override Column[] getColumns(); @Override void set(int idx, Object value); @Override Object get(int idx); @Override void set(String columnName, Object value); @Override Object get(String columnName); @Override void setBigint(int idx, Long value); @Override Long getBigint(int idx); @Override void setBigint(String columnName, Long value); @Override Long getBigint(String columnName); @Override void setDouble(int idx, Double value); @Override Double getDouble(int idx); @Override void setDouble(String columnName, Double value); @Override Double getDouble(String columnName); @Override void setBoolean(int idx, Boolean value); @Override Boolean getBoolean(int idx); @Override void setBoolean(String columnName, Boolean value); @Override Boolean getBoolean(String columnName); @Override void setDatetime(int idx, Date value); @Override Date getDatetime(int idx); @Override void setDatetime(String columnName, Date value); @Override Date getDatetime(String columnName); @Override void setDecimal(int idx, BigDecimal value); @Override BigDecimal getDecimal(int idx); @Override void setDecimal(String columnName, BigDecimal value); @Override BigDecimal getDecimal(String columnName); @Override void setString(int idx, String value); @Override String getString(int idx); @Override void setString(String columnName, String value); @Override String getString(String columnName); @Override void setString(int idx, byte[] value); @Override void setString(String columnName, byte[] value); @Override byte[] getBytes(int idx); @Override byte[] getBytes(String columnName); void setBinary(int idx, Binary value); void setBinary(String columnName, Binary value); Binary getBinary(int idx); Binary getBinary(String columnName); @Override void set(Object[] values); @Override Object[] toArray(); void clear(); void setArray(String columnName, List list); void setArray(int idx, List list); void setMap(int idx, Map map); void setMap(String columnName, Map map); List<T> getArray(Class<T> className, String columnName); List<T> getArray(Class<T> className, int idx); List getArray(String columnName); List getArray(int idx); Map<k, v> getMap(Class<k> keyClass, Class<v> valueClass, String columnName); Map<k, v> getMap(Class<k> keyClass, Class<v> valueClass, int idx); Map getMap(String columnName); Map getMap(int idx); void setChar(int idx, Char value); void setChar(String columnName, Char value); Char getChar(int idx); Char getChar(String columnName); void setVarchar(int idx, Varchar value); void setVarchar(String columnName, Varchar value); Varchar getVarchar(int idx); Varchar getVarchar(String columnName); void setDate(int idx, java.sql.Date value); java.sql.Date getDate(int idx); void setDate(String columnName, java.sql.Date value); java.sql.Date getDate(String columnName); void setTimestamp(int idx, Timestamp value); Timestamp getTimestamp(int idx); void setTimestamp(String columnName, Timestamp value); Timestamp getTimestamp(String columnName); void setFloat(int idx, Float value); void setFloat(String columnName, Float value); Float getFloat(int idx); Float getFloat(String columnName); void setInt(int idx, Integer value); void setInt(String columnName, Integer value); Integer getInt(int idx); Integer getInt(String columnName); void setTinyint(int idx, Byte value); void setTinyint(String columnName, Byte value); Byte getTinyint(int idx); Byte getTinyint(String columnName); void setSmallint(int idx, Short value); void setSmallint(String columnName, Short value); Short getSmallint(int idx); Short getSmallint(String columnName); void setStruct(int idx, Struct value); void setStruct(String columnName, Struct value); Struct getStruct(int idx); Struct getStruct(String columnName); IntervalYearMonth getIntervalYearMonth(int idx); IntervalYearMonth getIntervalYearMonth(String columnName); void setIntervalYearMonth(int idx, IntervalYearMonth value); void setIntervalYearMonth(String columnName, IntervalYearMonth value); IntervalDayTime getIntervalDayTime(int idx); IntervalDayTime getIntervalDayTime(String columnName); void setIntervalDayTime(int idx, IntervalDayTime value); void setIntervalDayTime(String columnName, IntervalDayTime value); @Override boolean isNull(int idx); @Override boolean isNull(String columnName); @Override Record clone(); @SuppressWarnings({"unchecked"}) /** * set record column value directly without type validation * unsafe: caller must ensure correct type and do validation check externally when necessary */ void setWithoutValidation(int idx, Object o);  }