Create a new TableSchema from a file schema and partition columns. The table schema is automatically computed by appending the partition columns to the file schema. You should prefer calling this method over chaining [`TableSchema::from_file_schema`] and [`TableSchema::with_table_partition_cols`] if you have both the file schema and partition columns available at construction time since it avoid
(file_schema: SchemaRef, table_partition_cols: Vec<FieldRef>)
| 117 | /// assert_eq!(table_schema.table_schema().fields().len(), 4); |
| 118 | /// ``` |
| 119 | pub fn new(file_schema: SchemaRef, table_partition_cols: Vec<FieldRef>) -> Self { |
| 120 | let mut builder = SchemaBuilder::from(file_schema.as_ref()); |
| 121 | builder.extend(table_partition_cols.iter().cloned()); |
| 122 | Self { |
| 123 | file_schema, |
| 124 | table_partition_cols: Arc::new(table_partition_cols), |
| 125 | table_schema: Arc::new(builder.finish()), |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | /// Create a new TableSchema with no partition columns. |
| 130 | /// |