Create a table provider from a Paimon table. Loads the table schema and converts it to Arrow for DataFusion.
(table: Table)
| 60 | /// |
| 61 | /// Loads the table schema and converts it to Arrow for DataFusion. |
| 62 | pub fn try_new(table: Table) -> DFResult<Self> { |
| 63 | let mut fields = table.schema().fields().to_vec(); |
| 64 | let core_options = paimon::spec::CoreOptions::new(table.schema().options()); |
| 65 | if core_options.data_evolution_enabled() { |
| 66 | fields.push(paimon::spec::DataField::new( |
| 67 | paimon::spec::ROW_ID_FIELD_ID, |
| 68 | paimon::spec::ROW_ID_FIELD_NAME.to_string(), |
| 69 | paimon::spec::DataType::BigInt(paimon::spec::BigIntType::with_nullable(true)), |
| 70 | )); |
| 71 | } |
| 72 | let schema = |
| 73 | paimon::arrow::build_target_arrow_schema(&fields).map_err(to_datafusion_error)?; |
| 74 | Ok(Self { table, schema }) |
| 75 | } |
| 76 | |
| 77 | pub fn table(&self) -> &Table { |
| 78 | &self.table |
nothing calls this directly
no test coverage detected