Class CsvSchema

  • All Implemented Interfaces:
    Schema

    public class CsvSchema
    extends AbstractSchema
    Schema mapped onto a directory of CSV files. Each table in the schema is a CSV file in that directory.
    • Field Detail

      • directoryFile

        private final java.io.File directoryFile
      • tableMap

        private java.util.Map<java.lang.String,​Table> tableMap
    • Constructor Detail

      • CsvSchema

        public CsvSchema​(java.io.File directoryFile,
                         CsvTable.Flavor flavor)
        Creates a CSV schema.
        Parameters:
        directoryFile - Directory that holds .csv files
        flavor - Whether to instantiate flavor tables that undergo query optimization
    • Method Detail

      • trim

        private static java.lang.String trim​(java.lang.String s,
                                             java.lang.String suffix)
        Looks for a suffix on a string and returns either the string with the suffix removed or the original string.
      • trimOrNull

        private static java.lang.String trimOrNull​(java.lang.String s,
                                                   java.lang.String suffix)
        Looks for a suffix on a string and returns either the string with the suffix removed or null.
      • createTableMap

        private java.util.Map<java.lang.String,​Table> createTableMap()
      • createTable

        private Table createTable​(Source source)
        Creates different sub-type of table based on the "flavor" attribute.