public void setTypeSizeAndInBytes(SchemaColumn typeSource) {
   setValueType(typeSource.getType());
   setValueSize(typeSource.getSize());
   m_inBytes = typeSource.getExpression().getInBytes();
 }
Example #2
0
  @Override
  public String toString() {
    String retval = "SQL:\n\t" + sql + "\n";

    retval += "PARAMETERS:\n\t";
    for (VoltType param : paramList) {
      retval += param.toString() + " ";
    }

    retval += "\nTABLE SOURCES:\n\t";
    for (Table table : tableList) {
      retval += table.getTypeName() + " ";
    }

    retval += "\nSCAN COLUMNS:\n";
    if (scanColumns != null) {
      for (String table : scanColumns.keySet()) {
        retval += "\tTable: " + table + ":\n";
        for (SchemaColumn col : scanColumns.get(table)) {
          retval += "\t\tColumn: " + col.getColumnName() + ": ";
          retval += col.getExpression().toString() + "\n";
        }
      }
    } else {
      retval += "\tALL\n";
    }

    if (where != null) {
      retval += "\nWHERE:\n";
      retval += "\t" + where.toString() + "\n";

      retval += "WHERE SELECTION LIST:\n";
      int i = 0;
      for (AbstractExpression expr : whereSelectionList)
        retval += "\t(" + String.valueOf(i++) + ") " + expr.toString() + "\n";

      retval += "NO TABLE SELECTION LIST:\n";
      i = 0;
      for (AbstractExpression expr : noTableSelectionList)
        retval += "\t(" + String.valueOf(i++) + ") " + expr.toString() + "\n";

      retval += "TABLE FILTER LIST:\n";
      for (Entry<Table, ArrayList<AbstractExpression>> pair : tableFilterList.entrySet()) {
        i = 0;
        retval += "\tTABLE: " + pair.getKey().getTypeName() + "\n";
        for (AbstractExpression expr : pair.getValue())
          retval += "\t\t(" + String.valueOf(i++) + ") " + expr.toString() + "\n";
      }

      retval += "JOIN CLAUSE LIST:\n";
      for (Entry<TablePair, ArrayList<AbstractExpression>> pair : joinSelectionList.entrySet()) {
        i = 0;
        retval +=
            "\tTABLES: "
                + pair.getKey().t1.getTypeName()
                + " and "
                + pair.getKey().t2.getTypeName()
                + "\n";
        for (AbstractExpression expr : pair.getValue())
          retval += "\t\t(" + String.valueOf(i++) + ") " + expr.toString() + "\n";
      }
    }
    return retval;
  }