for(ResultColumnMetadata m : metadata) { final AvaticaType bundledSqlDataType = getAvaticaType(m.getDataType()); m.getAutoIncrement(), m.getCaseSensitivity(), m.getSearchability() != ColumnSearchability.NONE, m.getIsCurrency(), m.getIsNullable() ? ResultSetMetaData.columnNullable : ResultSetMetaData.columnNoNulls, m.getSigned(), m.getDisplaySize(), m.getLabel(), m.getColumnName(), m.getSchemaName(), m.getPrecision(), m.getScale(), m.getTableName(), m.getCatalogName(), bundledSqlDataType, m.getUpdatability() == ColumnUpdatability.READ_ONLY, m.getUpdatability() == ColumnUpdatability.WRITABLE, m.getUpdatability() == ColumnUpdatability.WRITABLE, m.getClassName() )); offset++;
public Builder mergeFrom(org.apache.drill.exec.proto.UserProtos.ResultColumnMetadata other) { if (other == org.apache.drill.exec.proto.UserProtos.ResultColumnMetadata.getDefaultInstance()) return this; if (other.hasCatalogName()) { bitField0_ |= 0x00000001; catalogName_ = other.catalogName_; onChanged(); if (other.hasSchemaName()) { bitField0_ |= 0x00000002; schemaName_ = other.schemaName_; onChanged(); if (other.hasTableName()) { bitField0_ |= 0x00000004; tableName_ = other.tableName_; onChanged(); if (other.hasColumnName()) { bitField0_ |= 0x00000008; columnName_ = other.columnName_; onChanged(); if (other.hasLabel()) { bitField0_ |= 0x00000010; label_ = other.label_; onChanged(); if (other.hasDataType()) { bitField0_ |= 0x00000020; dataType_ = other.dataType_;
if(message.hasCatalogName()) output.writeString(1, message.getCatalogName(), false); if(message.hasSchemaName()) output.writeString(2, message.getSchemaName(), false); if(message.hasTableName()) output.writeString(3, message.getTableName(), false); if(message.hasColumnName()) output.writeString(4, message.getColumnName(), false); if(message.hasLabel()) output.writeString(5, message.getLabel(), false); if(message.hasDataType()) output.writeString(6, message.getDataType(), false); if(message.hasIsNullable()) output.writeBool(7, message.getIsNullable(), false); if(message.hasPrecision()) output.writeInt32(8, message.getPrecision(), false); if(message.hasScale()) output.writeInt32(9, message.getScale(), false); if(message.hasSigned()) output.writeBool(10, message.getSigned(), false); if(message.hasDisplaySize()) output.writeInt32(11, message.getDisplaySize(), false); if(message.hasIsAliased()) output.writeBool(12, message.getIsAliased(), false); if(message.hasSearchability()) output.writeEnum(13, message.getSearchability().getNumber(), false); if(message.hasUpdatability()) output.writeEnum(14, message.getUpdatability().getNumber(), false); if(message.hasAutoIncrement())
for(ResultColumnMetadata m : metadata) { final AvaticaType bundledSqlDataType = getAvaticaType(m.getDataType()); m.getAutoIncrement(), m.getCaseSensitivity(), m.getSearchability() != ColumnSearchability.NONE, m.getIsCurrency(), m.getIsNullable() ? ResultSetMetaData.columnNullable : ResultSetMetaData.columnNoNulls, m.getSigned(), m.getDisplaySize(), m.getLabel(), m.getColumnName(), m.getSchemaName(), m.getPrecision(), m.getScale(), m.getTableName(), m.getCatalogName(), bundledSqlDataType, m.getUpdatability() == ColumnUpdatability.READ_ONLY, m.getUpdatability() == ColumnUpdatability.WRITABLE, m.getUpdatability() == ColumnUpdatability.WRITABLE, m.getClassName() )); offset++;
/** * <code>optional string class_name = 18;</code> * * <pre> * * A fully-qualified name of the Java class whose instances are created * if the method ResultSet.getObject is called to retrieve * a value from the column. Applicable only to JDBC clients. * </pre> */ public Builder clearClassName() { bitField0_ = (bitField0_ & ~0x00020000); className_ = getDefaultInstance().getClassName(); onChanged(); return this; } /**
/** * <code>optional string catalog_name = 1;</code> * * <pre> * * Designated column's catalog name. Empty string if not applicable. * Defaults to "DRILL" as drill has only one catalog. * </pre> */ public Builder clearCatalogName() { bitField0_ = (bitField0_ & ~0x00000001); catalogName_ = getDefaultInstance().getCatalogName(); onChanged(); return this; } /**
/** * <code>optional string data_type = 6;</code> * * <pre> * * Data type in string format. Value is SQL standard type. * </pre> */ public Builder clearDataType() { bitField0_ = (bitField0_ & ~0x00000020); dataType_ = getDefaultInstance().getDataType(); onChanged(); return this; } /**
/** * <code>optional string column_name = 4;</code> * * <pre> * column name * </pre> */ public Builder clearColumnName() { bitField0_ = (bitField0_ & ~0x00000008); columnName_ = getDefaultInstance().getColumnName(); onChanged(); return this; } /**
public Builder mergeFrom(org.apache.drill.exec.proto.UserProtos.ResultColumnMetadata other) { if (other == org.apache.drill.exec.proto.UserProtos.ResultColumnMetadata.getDefaultInstance()) return this; if (other.hasCatalogName()) { bitField0_ |= 0x00000001; catalogName_ = other.catalogName_; onChanged(); if (other.hasSchemaName()) { bitField0_ |= 0x00000002; schemaName_ = other.schemaName_; onChanged(); if (other.hasTableName()) { bitField0_ |= 0x00000004; tableName_ = other.tableName_; onChanged(); if (other.hasColumnName()) { bitField0_ |= 0x00000008; columnName_ = other.columnName_; onChanged(); if (other.hasLabel()) { bitField0_ |= 0x00000010; label_ = other.label_; onChanged(); if (other.hasDataType()) { bitField0_ |= 0x00000020; dataType_ = other.dataType_;
if(message.hasCatalogName()) output.writeString(1, message.getCatalogName(), false); if(message.hasSchemaName()) output.writeString(2, message.getSchemaName(), false); if(message.hasTableName()) output.writeString(3, message.getTableName(), false); if(message.hasColumnName()) output.writeString(4, message.getColumnName(), false); if(message.hasLabel()) output.writeString(5, message.getLabel(), false); if(message.hasDataType()) output.writeString(6, message.getDataType(), false); if(message.hasIsNullable()) output.writeBool(7, message.getIsNullable(), false); if(message.hasPrecision()) output.writeInt32(8, message.getPrecision(), false); if(message.hasScale()) output.writeInt32(9, message.getScale(), false); if(message.hasSigned()) output.writeBool(10, message.getSigned(), false); if(message.hasDisplaySize()) output.writeInt32(11, message.getDisplaySize(), false); if(message.hasIsAliased()) output.writeBool(12, message.getIsAliased(), false); if(message.hasSearchability()) output.writeEnum(13, message.getSearchability().getNumber(), false); if(message.hasUpdatability()) output.writeEnum(14, message.getUpdatability().getNumber(), false); if(message.hasAutoIncrement())
/** * <code>optional string class_name = 18;</code> * * <pre> * * A fully-qualified name of the Java class whose instances are created * if the method ResultSet.getObject is called to retrieve * a value from the column. Applicable only to JDBC clients. * </pre> */ public Builder clearClassName() { bitField0_ = (bitField0_ & ~0x00020000); className_ = getDefaultInstance().getClassName(); onChanged(); return this; } /**
/** * <code>optional string catalog_name = 1;</code> * * <pre> * * Designated column's catalog name. Empty string if not applicable. * Defaults to "DRILL" as drill has only one catalog. * </pre> */ public Builder clearCatalogName() { bitField0_ = (bitField0_ & ~0x00000001); catalogName_ = getDefaultInstance().getCatalogName(); onChanged(); return this; } /**
/** * <code>optional string column_name = 4;</code> * * <pre> * column name * </pre> */ public Builder clearColumnName() { bitField0_ = (bitField0_ & ~0x00000008); columnName_ = getDefaultInstance().getColumnName(); onChanged(); return this; } /**
/** * <code>optional string data_type = 6;</code> * * <pre> * * Data type in string format. Value is SQL standard type. * </pre> */ public Builder clearDataType() { bitField0_ = (bitField0_ & ~0x00000020); dataType_ = getDefaultInstance().getDataType(); onChanged(); return this; } /**
private void verifyColumnsMetadata(List<UserProtos.ResultColumnMetadata> columnsList, Map<String, Integer> expectedResult) { for (UserProtos.ResultColumnMetadata columnMetadata : columnsList) { assertTrue("Column should be present in result set", expectedResult.containsKey(columnMetadata.getColumnName())); Integer expectedSize = expectedResult.get(columnMetadata.getColumnName()); assertNotNull("Expected size should not be null", expectedSize); assertEquals("Display size should match", expectedSize.intValue(), columnMetadata.getDisplaySize()); assertEquals("Precision should match", expectedSize.intValue(), columnMetadata.getPrecision()); assertTrue("Column should be nullable", columnMetadata.getIsNullable()); } }