@Override public void write(InternalRow internalRow) throws IOException { try { int i=0; for (StructField field : schema.fields()) { DataType dataType = field.dataType(); if (internalRow.isNullAt(i)) { statement.setNull(i + 1, SparkJdbcUtil.getJdbcType(dataType, PhoenixJdbcDialect$.MODULE$).jdbcNullType()); } else { Row row = SparkJdbcUtil.toRow(schema, internalRow); SparkJdbcUtil.makeSetter(conn, PhoenixJdbcDialect$.MODULE$, dataType).apply(statement, row, i); } ++i; } statement.execute(); } catch (SQLException e) { throw new IOException("Exception while executing Phoenix prepared statement", e); } }
@Override public Object get(InternalRow row) { if (row.isNullAt(p)) { return null; } return row.get(p, type).toString(); } }
@Override public Object get(InternalRow row) { if (row.isNullAt(p)) { return null; } return row.get(p, type); } }
@Override public Object get(InternalRow row) { if (row.isNullAt(p)) { return null; } return ((Decimal) row.get(p, type)).toJavaBigDecimal(); } }
@Override public void write(InternalRow row, Encoder encoder) throws IOException { for (int i = 0; i < types.length; i += 1) { if (row.isNullAt(i)) { writers[i].write(null, encoder); } else { write(row, i, writers[i], encoder); } } }
DataType t = col.dataType(); if (row.isNullAt(fieldIdx)) { col.putNulls(0, capacity); } else {
DataType t = col.dataType(); if (row.isNullAt(fieldIdx)) { col.putNulls(0, capacity); } else {
DataType t = col.dataType(); if (row.isNullAt(fieldIdx)) { col.putNulls(0, capacity); } else {
public UnsafeRow apply(InternalRow i) { holder.reset(); rowWriter.zeroOutNullBytes(); boolean isNull = i.isNullAt(0); long value = isNull ? -1L : (i.getLong(0)); if (isNull) { rowWriter.setNullAt(0); } else { rowWriter.write(0, value); } boolean isNull1 = i.isNullAt(1); UTF8String value1 = isNull1 ? null : (i.getUTF8String(1)); if (isNull1) { rowWriter.setNullAt(1); } else { rowWriter.write(1, value1); } result.setTotalSize(holder.totalSize()); return result; } }
Object[] data = new Object[struct.fields().size()]; for (int i = 0; i < data.length; i += 1) { if (internalRow.isNullAt(i)) { data[i] = null; } else {
DataType t = col.dataType(); if (row.isNullAt(fieldIdx)) { col.putNulls(0, capacity); } else {
boolean isNull = i.isNullAt(0); MapData value = isNull ? null : (i.getMap(0)); if (isNull) {
boolean isNull = i.isNullAt(0); MapData value = isNull ? null : (i.getMap(0)); if (isNull) {