File tree 1 file changed +9
-11
lines changed
src/FlowtideDotNet.Core/Sources/Generic/Internal
1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change 10
10
// See the License for the specific language governing permissions and
11
11
// limitations under the License.
12
12
13
+ using FlowtideDotNet . Core . ColumnStore . ObjectConverter ;
13
14
using FlowtideDotNet . Substrait . Sql ;
15
+ using FlowtideDotNet . Substrait . Type ;
14
16
using System . Diagnostics . CodeAnalysis ;
15
17
16
18
namespace FlowtideDotNet . Core . Sources . Generic . Internal
@@ -21,18 +23,14 @@ internal class GenericTableProvider<T> : ITableProvider
21
23
22
24
public GenericTableProvider ( string name )
23
25
{
24
- var properties = typeof ( T ) . GetProperties ( ) ;
25
- var columnNames = properties . Select ( x =>
26
+ var schema = BatchConverter . GetBatchConverter ( typeof ( T ) ) . GetSchema ( ) ;
27
+ schema . Names . Add ( "__key" ) ;
28
+ if ( schema . Struct != null )
26
29
{
27
- return x . Name ;
28
- } ) . ToList ( ) ;
29
-
30
- columnNames . Add ( "__key" ) ;
31
-
32
- _tableMetadata = new TableMetadata ( name , new Substrait . Type . NamedStruct ( )
33
- {
34
- Names = columnNames
35
- } ) ;
30
+ schema . Struct . Types . Add ( new StringType ( ) ) ;
31
+ }
32
+
33
+ _tableMetadata = new TableMetadata ( name , schema ) ;
36
34
}
37
35
38
36
public bool TryGetTableInformation ( IReadOnlyList < string > tableName , [ NotNullWhen ( true ) ] out TableMetadata ? tableMetadata )
You can’t perform that action at this time.
0 commit comments