Meta.Frame frame = Meta.Frame.create(0, true, tables); StructType fieldMetaData = drillFieldMetaData(clazz); Meta.Signature signature = Meta.Signature.create(
Meta.Frame.create( 0, true,
Frame frame = Frame.create(Integer.MAX_VALUE, true, rows);
Frame frame = Frame.create(Integer.MAX_VALUE, true, rows);
frameRows.add(new Object[] {true, "my_string"}); Meta.Frame frame = Frame.create(0, true, frameRows); RpcMetadataResponse metadata = new RpcMetadataResponse("localhost:8765"); FetchResponse response = new FetchResponse(frame, false, false, metadata);
MetaImpl.columnMetaData("C2", 1, String.class, true)), null, null, Meta.CursorFactory.ARRAY, Meta.StatementType.SELECT), Meta.Frame.create(0, true, Arrays.<Object>asList(new Object[] {1, "a"}, new Object[] {null, "b"}, new Object[] {3, "c"})), -1, null)); MetaImpl.columnMetaData("ORDINAL_POSITION", 1, Long.class, true)), null, Collections.<AvaticaParameter>emptyList(), Meta.CursorFactory.ARRAY, null), Meta.Frame.create(0, true, Arrays.<Object>asList(new Object[] {new Object[]{"my_table", 10}})), -1, null));
Frame frame = Frame.create(Integer.MAX_VALUE, true, rows);
MetaImpl.columnMetaData("ORDINAL_POSITION", 1, Long.class)), null, Collections.<AvaticaParameter>emptyList(), Meta.CursorFactory.ARRAY, null), Meta.Frame.create(0, true, Arrays.<Object>asList(new Object[] {new Object[]{"my_table", 10}})), -1, null));
frameRows.add(new Object[] {true, "my_string"}); Meta.Frame frame = Frame.create(0, true, frameRows); RpcMetadataResponse metadata = new RpcMetadataResponse("localhost:8765"); FetchResponse response = new FetchResponse(frame, false, false, metadata);
MetaImpl.columnMetaData("C2", 1, String.class, true)), null, null, Meta.CursorFactory.ARRAY, Meta.StatementType.SELECT), Meta.Frame.create(0, true, Arrays.<Object>asList(new Object[] {1, "a"}, new Object[] {null, "b"}, new Object[] {3, "c"})), -1, null)); MetaImpl.columnMetaData("ORDINAL_POSITION", 1, Long.class, true)), null, Collections.<AvaticaParameter>emptyList(), Meta.CursorFactory.ARRAY, null), Meta.Frame.create(0, true, Arrays.<Object>asList(new Object[] {new Object[]{"my_table", 10}})), -1, null));
frameRows.add(new Object[] {true, "my_string"}); Meta.Frame frame = Frame.create(0, true, frameRows); RpcMetadataResponse metadata = new RpcMetadataResponse("localhost:8765"); FetchResponse response = new FetchResponse(frame, false, false, metadata);
Meta.Frame frame = Meta.Frame.create(0, true, tables); StructType fieldMetaData = drillFieldMetaData(clazz); Meta.Signature signature = Meta.Signature.create(
Meta.Frame frame = Meta.Frame.create(0, true, rows); StructType fieldMetaData = DremioMetaImpl.fieldMetaData(clazz); Meta.Signature signature = Meta.Signature.create(
@Test public void testDeprecatedValueAttributeForArrays() { // Create a row with schema: [VARCHAR, ARRAY] List<Object> rows = Collections.<Object>singletonList(new Object[] {"string", Arrays.asList(1, 2, 3)}); Meta.Frame frame = Meta.Frame.create(0, true, rows); // Convert it to a protobuf Common.Frame protoFrame = frame.toProto(); assertEquals(1, protoFrame.getRowsCount()); // Get that row we created Common.Row protoRow = protoFrame.getRows(0); // One row has many columns List<Common.ColumnValue> protoColumns = protoRow.getValueList(); // We should have two columns assertEquals(2, protoColumns.size()); // Fetch the ARRAY column Common.ColumnValue protoColumn = protoColumns.get(1); // We should have the 3 ARRAY elements in the array_values attribute as well as the deprecated // values attribute. List<Common.TypedValue> deprecatedValues = protoColumn.getValueList(); assertEquals(3, deprecatedValues.size()); assertTrue("Column 2 should have an array_value", protoColumns.get(1).getHasArrayValue()); List<Common.TypedValue> arrayValues = protoColumns.get(1).getArrayValueList(); assertEquals(arrayValues, deprecatedValues); }
@Test public void testDeprecatedValueAttributeForScalars() { // Create a row with schema: [VARCHAR, INTEGER, DATE] List<Object> rows = Collections.<Object>singletonList(new Object[] {"string", Integer.MAX_VALUE, new Date().getTime()}); Meta.Frame frame = Meta.Frame.create(0, true, rows); // Convert it to a protobuf Common.Frame protoFrame = frame.toProto(); assertEquals(1, protoFrame.getRowsCount()); // Get that row we created Common.Row protoRow = protoFrame.getRows(0); // One row has many columns List<Common.ColumnValue> protoColumns = protoRow.getValueList(); assertEquals(3, protoColumns.size()); // Verify that the scalar value is also present in the deprecated values attributes. List<Common.TypedValue> deprecatedValues = protoColumns.get(0).getValueList(); assertEquals(1, deprecatedValues.size()); Common.TypedValue scalarValue = protoColumns.get(0).getScalarValue(); assertEquals(deprecatedValues.get(0), scalarValue); }
@Test public void testDeprecatedValueAttributeForArrays() { // Create a row with schema: [VARCHAR, ARRAY] List<Object> rows = Collections.<Object>singletonList(new Object[] {"string", Arrays.asList(1, 2, 3)}); Meta.Frame frame = Meta.Frame.create(0, true, rows); // Convert it to a protobuf Common.Frame protoFrame = frame.toProto(); assertEquals(1, protoFrame.getRowsCount()); // Get that row we created Common.Row protoRow = protoFrame.getRows(0); // One row has many columns List<Common.ColumnValue> protoColumns = protoRow.getValueList(); // We should have two columns assertEquals(2, protoColumns.size()); // Fetch the ARRAY column Common.ColumnValue protoColumn = protoColumns.get(1); // We should have the 3 ARRAY elements in the array_values attribute as well as the deprecated // values attribute. List<Common.TypedValue> deprecatedValues = protoColumn.getValueList(); assertEquals(3, deprecatedValues.size()); assertTrue("Column 2 should have an array_value", protoColumns.get(1).getHasArrayValue()); List<Common.TypedValue> arrayValues = protoColumns.get(1).getArrayValueList(); assertEquals(arrayValues, deprecatedValues); }
@Test public void testDeprecatedValueAttributeForScalars() { // Create a row with schema: [VARCHAR, INTEGER, DATE] List<Object> rows = Collections.<Object>singletonList(new Object[] {"string", Integer.MAX_VALUE, new Date().getTime()}); Meta.Frame frame = Meta.Frame.create(0, true, rows); // Convert it to a protobuf Common.Frame protoFrame = frame.toProto(); assertEquals(1, protoFrame.getRowsCount()); // Get that row we created Common.Row protoRow = protoFrame.getRows(0); // One row has many columns List<Common.ColumnValue> protoColumns = protoRow.getValueList(); assertEquals(3, protoColumns.size()); // Verify that the scalar value is also present in the deprecated values attributes. List<Common.TypedValue> deprecatedValues = protoColumns.get(0).getValueList(); assertEquals(1, deprecatedValues.size()); Common.TypedValue scalarValue = protoColumns.get(0).getScalarValue(); assertEquals(deprecatedValues.get(0), scalarValue); }