Ejemplo n.º 1
0
 @Test
 public void testForeignTemp() {
   Create create = new Create();
   create.setTable(new GroupSymbol("tempTable")); // $NON-NLS-1$
   create.setOn("source");
   Table t = new Table();
   t.setName("tempTable");
   t.setUUID("tid:0");
   Column c = new Column();
   c.setName("x");
   c.setUUID("tid:0");
   Datatype string = SystemMetadata.getInstance().getRuntimeTypeMap().get("string");
   c.setDatatype(string, true);
   t.addColumn(c);
   c = new Column();
   c.setName("y");
   c.setUUID("tid:0");
   Datatype decimal = SystemMetadata.getInstance().getRuntimeTypeMap().get("decimal");
   c.setDatatype(decimal, true);
   t.addColumn(c);
   t.setCardinality(10000);
   create.setTableMetadata(t);
   helpTest(
       "create foreign temporary table tempTable (x string, y decimal) options (cardinality 10000) on source",
       "CREATE FOREIGN TEMPORARY TABLE tempTable (\n	x string,\n	y bigdecimal\n) OPTIONS (CARDINALITY 10000) ON 'source'",
       create); //$NON-NLS-1$ //$NON-NLS-2$
 }
Ejemplo n.º 2
0
  @Override
  public void visit(AggregateFunction obj) {
    if (!obj.getParameters().isEmpty()) {
      visitNodes(obj.getParameters());
    }

    if (obj.getName().equals(AggregateFunction.COUNT)) {
      HashMap<String, String> options = new HashMap<String, String>();
      options.put(CountStarIterator.ALIAS, this.currentAlias);
      options.put(CountStarIterator.ENCODING, this.ef.getEncoding());
      IteratorSetting it =
          new IteratorSetting(this.iteratorPriority++, CountStarIterator.class, options);

      // expression expects a column
      Column c = new Column();
      c.setName(this.currentAlias);
      c.setDatatype(
          SystemMetadata.getInstance()
              .getSystemStore()
              .getDatatypes()
              .get("integer")); // $NON-NLS-1$
      c.setProperty(AccumuloMetadataProcessor.CF, this.currentAlias);

      this.scanIterators.add(it);
      this.onGoingExpression.push(c);
    } else if (obj.getName().equals(AggregateFunction.AVG)) {
    } else if (obj.getName().equals(AggregateFunction.SUM)) {
    } else if (obj.getName().equals(AggregateFunction.MIN)) {
    } else if (obj.getName().equals(AggregateFunction.MAX)) {
    } else {
    }
  }