Csv DataSource, implements qlbridge schema DataSource, SourceConn, Scanner to allow csv files to be full featured databases. - very, very naive scanner, forward only single pass - can open a file with .Open() - assumes comma delimited - not thread-safe - does not implement write operations
| 30 | // - not thread-safe |
| 31 | // - does not implement write operations |
| 32 | type CsvDataSource struct { |
| 33 | table string |
| 34 | tbl *schema.Table |
| 35 | exit <-chan bool |
| 36 | csvr *csv.Reader |
| 37 | gz *gzip.Reader |
| 38 | rc io.ReadCloser |
| 39 | rowct uint64 |
| 40 | headers []string |
| 41 | colindex map[string]int |
| 42 | indexCol int |
| 43 | filter expr.Node |
| 44 | } |
| 45 | |
| 46 | // NewCsvSource reader assumes we are getting first row as headers |
| 47 | // - optionally may be gzipped |
nothing calls this directly
no outgoing calls
no test coverage detected