@Override public TypeInformation<?>[] getFieldTypes() { return schema.getFieldTypes(); }
@Override public TypeInformation<?>[] getFieldTypes() { return schema.getFieldTypes(); }
/** * @deprecated Use {@link TableSchema#getFieldTypes()} instead. Can be dropped after 1.7. */ @Deprecated public TypeInformation<?>[] getTypes() { return getFieldTypes(); }
/** * Adds a table schema under the given key. */ public void putTableSchema(String key, TableSchema schema) { checkNotNull(key); checkNotNull(schema); final String[] fieldNames = schema.getFieldNames(); final TypeInformation<?>[] fieldTypes = schema.getFieldTypes(); final List<List<String>> values = new ArrayList<>(); for (int i = 0; i < schema.getFieldCount(); i++) { values.add(Arrays.asList(fieldNames[i], TypeStringUtils.writeTypeInfo(fieldTypes[i]))); } putIndexedFixedProperties( key, Arrays.asList(TABLE_SCHEMA_NAME, TABLE_SCHEMA_TYPE), values); }
protected void openRow() { if (selectedRow == NO_ROW_SELECTED) { return; } final CliRowView view = new CliRowView( client, resultDescriptor.getResultSchema().getFieldNames(), CliUtils.typesToString(resultDescriptor.getResultSchema().getFieldTypes()), getRow(results.get(selectedRow))); view.open(); // enter view }
private static TableSchema removeTimeAttributes(TableSchema schema) { final TableSchema.Builder builder = TableSchema.builder(); for (int i = 0; i < schema.getFieldCount(); i++) { final TypeInformation<?> type = schema.getFieldTypes()[i]; final TypeInformation<?> convertedType; if (FlinkTypeFactory.isTimeIndicatorType(type)) { convertedType = Types.SQL_TIMESTAMP; } else { convertedType = type; } builder.field(schema.getFieldNames()[i], convertedType); } return builder.build(); } }
for (int i = 0; i < baseSchema.getFieldCount(); i++) { final String fieldName = baseSchema.getFieldNames()[i]; final TypeInformation<?> fieldType = baseSchema.getFieldTypes()[i];
/** * Creates a result. Might start threads or opens sockets so every created result must be closed. */ public <T> DynamicResult<T> createResult(Environment env, TableSchema schema, ExecutionConfig config) { final TypeInformation<Row> outputType = Types.ROW_NAMED(schema.getFieldNames(), schema.getFieldTypes()); if (env.getExecution().isStreamingExecution()) { // determine gateway address (and port if possible) final InetAddress gatewayAddress = getGatewayAddress(env.getDeployment()); final int gatewayPort = getGatewayPort(env.getDeployment()); if (env.getExecution().isChangelogMode()) { return new ChangelogCollectStreamResult<>(outputType, config, gatewayAddress, gatewayPort); } else { return new MaterializedCollectStreamResult<>( outputType, config, gatewayAddress, gatewayPort, env.getExecution().getMaxTableResultRows()); } } else { // Batch Execution if (!env.getExecution().isTableMode()) { throw new SqlExecutionException("Results of batch queries can only be served in table mode."); } return new MaterializedCollectBatchResult<>(outputType, config); } }
@Override public TypeInformation<?>[] getFieldTypes() { return schema.getFieldTypes(); }
/** * @deprecated Use {@link TableSchema#getFieldTypes()} instead. Can be dropped after 1.7. */ @Deprecated public TypeInformation<?>[] getTypes() { return getFieldTypes(); }
public CatalogTable( String tableType, TableSchema tableSchema, TableStats tableStats, Map<String, String> properties, boolean isStreaming) { this.tableType = tableType; this.tableSchema = tableSchema; this.tableStats = tableStats; this.properties = properties; this.isStreaming = isStreaming; this.richTableSchema = new RichTableSchema(tableSchema.getFieldNames(), tableSchema.getFieldTypes()); }
/** * Adds a table schema under the given key. */ public void putTableSchema(String key, TableSchema schema) { checkNotNull(key); checkNotNull(schema); final String[] fieldNames = schema.getFieldNames(); final InternalType[] fieldTypes = schema.getFieldTypes(); final List<List<String>> values = new ArrayList<>(); for (int i = 0; i < schema.getFieldCount(); i++) { values.add(Arrays.asList(fieldNames[i], TypeStringUtils.writeDataType(fieldTypes[i]))); } putIndexedFixedProperties( key, Arrays.asList(TABLE_SCHEMA_NAME, TABLE_SCHEMA_TYPE), values); }
/** * Adds a table schema under the given key. */ public void putTableSchema(String key, TableSchema schema) { checkNotNull(key); checkNotNull(schema); final String[] fieldNames = schema.getFieldNames(); final TypeInformation<?>[] fieldTypes = schema.getFieldTypes(); final List<List<String>> values = new ArrayList<>(); for (int i = 0; i < schema.getFieldCount(); i++) { values.add(Arrays.asList(fieldNames[i], TypeStringUtils.writeTypeInfo(fieldTypes[i]))); } putIndexedFixedProperties( key, Arrays.asList(TABLE_SCHEMA_NAME, TABLE_SCHEMA_TYPE), values); }
/** * Create an CatalogTable from Hive table. */ public static CatalogTable createCatalogTable(Table hiveTable, TableSchema tableSchema, TableStats tableStats) { return new CatalogTable( "hive", tableSchema, getPropertiesFromHiveTable(hiveTable), new RichTableSchema(tableSchema.getFieldNames(), tableSchema.getFieldTypes()), tableStats, null, getPartitionCols(hiveTable), hiveTable.getPartitionKeysSize() != 0, null, null, -1L, (long) hiveTable.getCreateTime(), (long) hiveTable.getLastAccessTime(), false); }
for (int i = 0; i < baseSchema.getFieldCount(); i++) { final String fieldName = baseSchema.getFieldNames()[i]; final InternalType fieldType = baseSchema.getFieldTypes()[i];
for (int i = 0; i < baseSchema.getFieldCount(); i++) { final String fieldName = baseSchema.getFieldNames()[i]; final TypeInformation<?> fieldType = baseSchema.getFieldTypes()[i];