@Override public <T> List<T> getList(int arg0) { return internalRow.getList(arg0); }
private static void appendValue(WritableColumnVector dst, DataType t, Row src, int fieldIdx) { if (t instanceof ArrayType) { ArrayType at = (ArrayType)t; if (src.isNullAt(fieldIdx)) { dst.appendNull(); } else { List<Object> values = src.getList(fieldIdx); dst.appendArray(values.size()); for (Object o : values) { appendValue(dst.arrayData(), at.elementType(), o); } } } else if (t instanceof StructType) { StructType st = (StructType)t; if (src.isNullAt(fieldIdx)) { dst.appendStruct(true); } else { dst.appendStruct(false); Row c = src.getStruct(fieldIdx); for (int i = 0; i < st.fields().length; i++) { appendValue(dst.getChild(i), st.fields()[i].dataType(), c, i); } } } else { appendValue(dst, t, src.get(fieldIdx)); } }
private static void appendValue(ColumnVector dst, DataType t, Row src, int fieldIdx) { if (t instanceof ArrayType) { ArrayType at = (ArrayType)t; if (src.isNullAt(fieldIdx)) { dst.appendNull(); } else { List<Object> values = src.getList(fieldIdx); dst.appendArray(values.size()); for (Object o : values) { appendValue(dst.arrayData(), at.elementType(), o); } } } else if (t instanceof StructType) { StructType st = (StructType)t; if (src.isNullAt(fieldIdx)) { dst.appendStruct(true); } else { dst.appendStruct(false); Row c = src.getStruct(fieldIdx); for (int i = 0; i < st.fields().length; i++) { appendValue(dst.getChildColumn(i), st.fields()[i].dataType(), c, i); } } } else { appendValue(dst, t, src.get(fieldIdx)); } }
private static void appendValue(WritableColumnVector dst, DataType t, Row src, int fieldIdx) { if (t instanceof ArrayType) { ArrayType at = (ArrayType)t; if (src.isNullAt(fieldIdx)) { dst.appendNull(); } else { List<Object> values = src.getList(fieldIdx); dst.appendArray(values.size()); for (Object o : values) { appendValue(dst.arrayData(), at.elementType(), o); } } } else if (t instanceof StructType) { StructType st = (StructType)t; if (src.isNullAt(fieldIdx)) { dst.appendStruct(true); } else { dst.appendStruct(false); Row c = src.getStruct(fieldIdx); for (int i = 0; i < st.fields().length; i++) { appendValue(dst.getChild(i), st.fields()[i].dataType(), c, i); } } } else { appendValue(dst, t, src.get(fieldIdx)); } }
/** * Returns true if the given CodeableConcept row has a Coding belonging to the ValueSet having the * given reference name, or false otherwise. */ private static Boolean inValueSet(Row codeableRow, String referenceName, BroadcastableValueSets valueSets) { boolean found = false; if (codeableRow != null) { List<Row> codingArray = codeableRow.getList(1); if (codingArray != null) { for (Row coding : codingArray) { String system = coding.getAs("system"); String code = coding.getAs("code"); // If there exists a matching code, return true. if (valueSets.hasCode(referenceName, system, code)) { found = true; break; } } } } return found; }
/** * Returns true if the given CodeableConcept row has a Coding belonging to the ValueSet having the * given reference name, or false otherwise. */ private static Boolean inValueSet(Row codeableRow, String referenceName, BroadcastableValueSets valueSets) { boolean found = false; if (codeableRow != null) { List<Row> codingArray = codeableRow.getList(1); if (codingArray != null) { for (Row coding : codingArray) { String system = coding.getAs("system"); String code = coding.getAs("code"); // If there exists a matching code, return true. if (valueSets.hasCode(referenceName, system, code)) { found = true; break; } } } } return found; }
break; case ARRAY: record.put(i, convert(field.schema(), row.getList(i))); break; case MAP:
builder.set(field.getName(), fromRowValue(row.getList(idx), fieldSchema, fieldPath)); } else if (fieldSchema.getType() == Schema.Type.MAP) { builder.set(field.getName(), fromRowValue(row.getJavaMap(idx), fieldSchema, fieldPath));
builder.set(field.getName(), fromRowValue(row.getList(idx), fieldSchema, fieldPath)); } else if (fieldSchema.getType() == Schema.Type.MAP) { builder.set(field.getName(), fromRowValue(row.getJavaMap(idx), fieldSchema, fieldPath));
builder.set(field.getName(), fromRowValue(row.getList(idx), fieldSchema, fieldPath)); } else if (fieldSchema.getType() == Schema.Type.MAP) { builder.set(field.getName(), fromRowValue(row.getJavaMap(idx), fieldSchema, fieldPath));
private static void appendValue(ColumnVector dst, DataType t, Row src, int fieldIdx) { if (t instanceof ArrayType) { ArrayType at = (ArrayType)t; if (src.isNullAt(fieldIdx)) { dst.appendNull(); } else { List<Object> values = src.getList(fieldIdx); dst.appendArray(values.size()); for (Object o : values) { appendValue(dst.arrayData(), at.elementType(), o); } } } else if (t instanceof StructType) { StructType st = (StructType)t; if (src.isNullAt(fieldIdx)) { dst.appendStruct(true); } else { dst.appendStruct(false); Row c = src.getStruct(fieldIdx); for (int i = 0; i < st.fields().length; i++) { appendValue(dst.getChildColumn(i), st.fields()[i].dataType(), c, i); } } } else { appendValue(dst, t, src.get(fieldIdx)); } }