Package org.apache.tajo.catalog

Examples of org.apache.tajo.catalog.Options


  public Session(SessionProto proto) {
    sessionId = proto.getSessionId();
    userName = proto.getUsername();
    currentDatabase = proto.getCurrentDatabase();
    lastAccessTime = proto.getLastAccessTime();
    Options options = new Options(proto.getVariables());
    sessionVariables = options.getAllKeyValus();
  }
View Full Code Here


    SessionProto.Builder builder = SessionProto.newBuilder();
    builder.setSessionId(sessionId);
    builder.setUsername(userName);
    builder.setCurrentDatabase(currentDatabase);
    builder.setLastAccessTime(lastAccessTime);
    Options variables = new Options();
    variables.putAll(this.sessionVariables);
    builder.setVariables(variables.getProto());
    return builder.build();
  }
View Full Code Here

    }
  }

  private void setUp() throws Exception {
    util = new LocalTajoTestingUtility();
    Options opt = new Options();
    opt.put(StorageConstants.CSVFILE_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
    util.setup(names, paths, schemas, opt);
  }
View Full Code Here

    TableDesc desc =  client.getTableDesc(CatalogUtil.normalizeIdentifier(res2.getMetaData().getTableName(1)));
    assertNotNull(desc);
    assertEquals(CatalogProtos.StoreType.CSV, desc.getMeta().getStoreType());


    Options options = desc.getMeta().getOptions();
    assertNotNull(options);
    assertEquals(StringEscapeUtils.escapeJava("\u0001"), options.get(StorageConstants.CSVFILE_DELIMITER));
  }
View Full Code Here

    schema.addColumn("col9", Type.TEXT);
    schema.addColumn("col10", Type.BLOB);
    schema.addColumn("col11", Type.INET4);
    schema.addColumn("col12", Type.NULL_TYPE);

    Options options = new Options();
    TableMeta meta = CatalogUtil.newTableMeta(storeType, options);
    meta.setOptions(StorageUtil.newPhysicalProperties(storeType));
    if (storeType == StoreType.AVRO) {
      meta.putOption(StorageConstants.AVRO_SCHEMA_LITERAL,
                     TEST_VARIOUS_TYPES_AVRO_SCHEMA);
View Full Code Here

    String [] data = {
        "1|filled|0.1",
        "2||",
        "3|filled|0.2"
    };
    Options opts = new Options();
    opts.put(StorageConstants.CSVFILE_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
    ResultSet res = TajoTestingCluster
        .run(table, schemas, opts, new String[][]{data},
            "select * from nulltable1 where col3 is null");
    try {
      assertTrue(res.next());
View Full Code Here

    String [] data = {
        "1|filled|",
        "||",
        "3|filled|"
    };
    Options opts = new Options();
    opts.put(StorageConstants.CSVFILE_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
    ResultSet res = TajoTestingCluster
        .run(table, schemas, opts, new String[][]{data},
            "select * from nulltable2 where col1 is not null");
    try {
      assertTrue(res.next());
View Full Code Here

    Schema [] schemas = new Schema[] {schema};
    String [] data = {
        ",,,,672287821,1301460,1,313895860387,126288907,1024",
        ",,,43578,19,13,6,3581,2557,1024"
    };
    Options opts = new Options();
    opts.put(StorageConstants.CSVFILE_DELIMITER, ",");
    ResultSet res = TajoTestingCluster
        .run(table, schemas, opts, new String[][]{data},
            "select * from nulltable3 where col1 is null and col2 is null and col3 is null and col4 = 43578");
    try {
      assertTrue(res.next());
View Full Code Here

    Schema [] schemas = new Schema[] {schema};
    String [] data = {
        "\\N,,,,672287821,",
        ",\\N,,43578"
    };
    Options opts = new Options();
    opts.put(StorageConstants.CSVFILE_DELIMITER, ",");
    opts.put(StorageConstants.CSVFILE_NULL, "\\\\N");
    ResultSet res = TajoTestingCluster
        .run(table, schemas, opts, new String[][]{data},
            "select * from nulltable4 where col1 is null and col2 is null and col3 is null and col5 is null and col4 = 43578");
    try {
      assertTrue(res.next());
View Full Code Here

    schema.addColumn("id", Type.INT4);
    schema.addColumn("file", Type.TEXT);
    schema.addColumn("name", Type.TEXT);
    schema.addColumn("age", Type.INT8);

    Options options = new Options();
    TableMeta meta = CatalogUtil.newTableMeta(storeType, options);
    meta.setOptions(StorageUtil.newPhysicalProperties(storeType));
    if (storeType == StoreType.AVRO) {
      meta.putOption(StorageConstants.AVRO_SCHEMA_LITERAL,
                     TEST_MULTIPLE_FILES_AVRO_SCHEMA);
View Full Code Here

TOP

Related Classes of org.apache.tajo.catalog.Options

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.