Examples of NoSuchColumnException


Examples of org.apache.tajo.engine.exception.NoSuchColumnException

          }
        }
      }

      if (relationOp == null) {
        throw new NoSuchColumnException(columnRef.getCanonicalName());
      }

      Schema schema = relationOp.getTableSchema();

      Column column = schema.getColumnByFQN(columnRef.getCanonicalName());
View Full Code Here

Examples of org.apache.tajo.engine.exception.NoSuchColumnException

  public String getNormalizedColumnName(QueryBlock block, ColumnReferenceExpr columnRef)
      throws PlanningException {
    Column found = resolveColumn(block, columnRef);
    if (found == null) {
      throw new NoSuchColumnException(columnRef.getCanonicalName());
    }
    return found.getQualifiedName();
  }
View Full Code Here

Examples of org.apache.tajo.engine.exception.NoSuchColumnException

      qualifier = columnRef.getQualifier();
      canonicalName = columnRef.getCanonicalName();
    } else {
      String resolvedDatabaseName = resolveDatabase(block, columnRef.getQualifier());
      if (resolvedDatabaseName == null) {
        throw new NoSuchColumnException(columnRef.getQualifier());
      }
      qualifier = CatalogUtil.buildFQName(resolvedDatabaseName, columnRef.getQualifier());
      canonicalName = CatalogUtil.buildFQName(qualifier, columnRef.getName());
    }
    qualifiedName = CatalogUtil.buildFQName(qualifier, columnRef.getName());

    RelationNode relationOp = block.getRelation(qualifier);

    // if a column name is outside of this query block
    if (relationOp == null) {
      // TODO - nested query can only refer outer query block? or not?
      for (QueryBlock eachBlock : queryBlocks.values()) {
        if (eachBlock.existsRelation(qualifier)) {
          relationOp = eachBlock.getRelation(qualifier);
        }
      }
    }

    // If we cannot find any relation against a qualified column name
    if (relationOp == null) {
      throw new NoSuchColumnException(canonicalName);
    }

    if (block.isAlreadyRenamedTableName(CatalogUtil.extractQualifier(canonicalName))) {
      String changedName = CatalogUtil.buildFQName(
          relationOp.getCanonicalName(),
          CatalogUtil.extractSimpleName(canonicalName));
      canonicalName = changedName;
    }

    Schema schema = relationOp.getTableSchema();
    Column column = schema.getColumn(canonicalName);
    if (column == null) {
      throw new NoSuchColumnException(canonicalName);
    }

    // If code reach here, a column is found.
    // But, it may be aliased from bottom logical node.
    // If the column is aliased, the found name may not be used in upper node.
View Full Code Here

Examples of org.apache.tajo.engine.exception.NoSuchColumnException

        }
      }

      // If we cannot find any relation against a qualified column name
      if (relationOp == null) {
        throw new NoSuchColumnException(CatalogUtil.buildFQName(qualifier, "*"));
      }

      Schema schema = relationOp.getTableSchema();
      Column[] resolvedColumns = new Column[schema.size()];
      return schema.getColumns().toArray(resolvedColumns);
    } else { // if a column reference is not qualified
      // columns of every relation should be resolved.
      Iterator<RelationNode> iterator = block.getRelations().iterator();
      Schema schema;
      List<Column> resolvedColumns = TUtil.newList();

      while (iterator.hasNext()) {
        relationOp = iterator.next();
        schema = relationOp.getTableSchema();
        resolvedColumns.addAll(schema.getColumns());
      }

      if (resolvedColumns.size() == 0) {
        throw new NoSuchColumnException(asteriskExpr.toString());
      }

      return resolvedColumns.toArray(new Column[resolvedColumns.size()]);
    }
  }
View Full Code Here

Examples of org.dbunit.dataset.NoSuchColumnException

  public Object getValue(int row, String column) throws DataSetException {
    if (row < 0 || row >= data.size()) {
      throw new RowOutOfBoundsException(); // !!! DbUnit uses this exception to detect end of iteration over rows!!!
    }
    if (!columnNameIndexes.containsKey(column)) {
      throw new NoSuchColumnException("No such column [" + column + "]");
    }
    int columnIndex = columnNameIndexes.get(column);
    return data.get(row).get(columnIndex);
  }
View Full Code Here

Examples of org.dbunit.dataset.NoSuchColumnException

   * @throws NoSuchColumnException If the column name is not known.
   */
  public int getColumnIndex(String column) throws NoSuchColumnException {
    column = column.toUpperCase();
    if (!columnNameIndexes.containsKey(column)) {
      throw new NoSuchColumnException("No such column [" + column + "]");
    }
    return columnNameIndexes.get(column);
  }
View Full Code Here

Examples of org.kiji.schema.NoSuchColumnException

  public void deleteFamily(EntityId entityId, String family, long upToTimestamp)
      throws IOException {
    final HBaseKijiTableWriter.WriterLayoutCapsule capsule = mWriterLayoutCapsule;
    final FamilyLayout familyLayout = capsule.getLayout().getFamilyMap().get(family);
    if (null == familyLayout) {
      throw new NoSuchColumnException(String.format("Family '%s' not found.", family));
    }

    if (familyLayout.getLocalityGroup().getFamilyMap().size() > 1) {
      // There are multiple families within the locality group, so we need to be clever.
      if (familyLayout.isGroupType()) {
View Full Code Here

Examples of org.kiji.schema.NoSuchColumnException

    for (Map.Entry<KijiColumnName, ColumnReaderSpec> override
        : overrides.entrySet()) {
      final KijiColumnName column = override.getKey();
      if (!layoutColumns.contains(column)
          && !layoutColumns.contains(new KijiColumnName(column.getFamily()))) {
        throw new NoSuchColumnException(String.format(
            "KijiTableLayout: %s does not contain column: %s", layout, column));
      } else {
        boundOverrides.put(column,
            BoundColumnReaderSpec.create(override.getValue(), column));
      }
    }
    mOverrides = boundOverrides;
    final Collection<BoundColumnReaderSpec> boundAlternatives = Sets.newHashSet();
    for (Map.Entry<KijiColumnName, ColumnReaderSpec> altsEntry
        : alternatives.entries()) {
      final KijiColumnName column = altsEntry.getKey();
      if (!layoutColumns.contains(column)
          && !layoutColumns.contains(KijiColumnName.create(column.getFamily()))) {
        throw new NoSuchColumnException(String.format(
            "KijiTableLayout: %s does not contain column: %s", layout, column));
      } else {
        boundAlternatives.add(
            BoundColumnReaderSpec.create(altsEntry.getValue(), altsEntry.getKey()));
      }
View Full Code Here

Examples of org.kiji.schema.NoSuchColumnException

   * @throws NoSuchColumnException if the column does not exist.
   */
  public CellSchema getCellSchema(KijiColumnName columnName) throws NoSuchColumnException {
    final FamilyLayout fLayout = mFamilyMap.get(columnName.getFamily());
    if (fLayout == null) {
      throw new NoSuchColumnException(String.format(
          "Table '%s' has no family '%s'.", getName(), columnName.getFamily()));
    }
    if (fLayout.isMapType()) {
      return CellSchema.newBuilder(fLayout.getDesc().getMapSchema()).build();
    }

    // Group-type family:
    Preconditions.checkArgument(columnName.isFullyQualified(),
        String.format("Cannot get CellFormat for entire group-type family: '%s'.", columnName));
    final FamilyLayout.ColumnLayout cLayout =
        fLayout.getColumnMap().get(columnName.getQualifier());
    if (cLayout == null) {
      throw new NoSuchColumnException(String.format(
          "Table '%s' has no column '%s'.", getName(), columnName));
    }
    return CellSchema.newBuilder(cLayout.getDesc().getColumnSchema()).build();
  }
View Full Code Here

Examples of org.kiji.schema.NoSuchColumnException

          }
        }
      }
    }

    throw new NoSuchColumnException(String.format(
        "Table '%s' has no family '%s'.", mDescBuilder.getName(), family.getFamily()));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.