@@ -633,7 +633,6 @@ export function getSchema(source) {
633
633
// function to do table operations on in-memory data?
634
634
export function __table ( source , operations ) {
635
635
const input = source ;
636
- let { columns} = source ;
637
636
let { schema, inferred} = getSchema ( source ) ;
638
637
// Combine column types from schema with user-selected types in operations
639
638
const types = new Map ( schema . map ( ( { name, type} ) => [ name , type ] ) ) ;
@@ -756,9 +755,6 @@ export function __table(source, operations) {
756
755
const schemaByName = new Map ( schema . map ( ( s ) => [ s . name , s ] ) ) ;
757
756
schema = operations . select . columns . map ( ( c ) => schemaByName . get ( c ) ) ;
758
757
}
759
- if ( columns ) {
760
- columns = operations . select . columns ;
761
- }
762
758
source = source . map ( ( d ) =>
763
759
Object . fromEntries ( operations . select . columns . map ( ( c ) => [ c , d [ c ] ] ) )
764
760
) ;
@@ -771,12 +767,6 @@ export function __table(source, operations) {
771
767
return ( { ...s , ...( override ? { name : override . name } : null ) } ) ;
772
768
} ) ;
773
769
}
774
- if ( columns ) {
775
- columns = columns . map ( ( c ) => {
776
- const override = overridesByName . get ( c ) ;
777
- return override ?. name ?? c ;
778
- } ) ;
779
- }
780
770
source = source . map ( ( d ) =>
781
771
Object . fromEntries ( Object . keys ( d ) . map ( ( k ) => {
782
772
const override = overridesByName . get ( k ) ;
@@ -786,7 +776,6 @@ export function __table(source, operations) {
786
776
}
787
777
if ( source !== input ) {
788
778
if ( schema ) source . schema = schema ;
789
- if ( columns ) source . columns = columns ;
790
779
}
791
780
return source ;
792
781
}
0 commit comments