/** * Retrieve skewed column name for a table. * @param alias table alias * @return */ public List<String> getSkewedColumnNames(String alias) { List<String> skewedColNames = null; if (null != qbm && null != qbm.getAliasToTable() && qbm.getAliasToTable().size() > 0) { Table tbl = getMetaData().getTableForAlias(alias); skewedColNames = tbl.getSkewedColNames(); } return skewedColNames; }
/** * Gets the strongest encrypted table path. * * @param qb The QB object that contains a list of all table locations. * @return The strongest encrypted path. It may return NULL if there are not tables encrypted, or are not HDFS tables. * @throws HiveException if an error occurred attempting to compare the encryption strength */ private Path getStrongestEncryptedTablePath(QB qb) throws HiveException { List<String> tabAliases = new ArrayList<String>(qb.getTabAliases()); Path strongestPath = null; /* Walk through all found table locations to get the most encrypted table */ for (String alias : tabAliases) { Table tab = qb.getMetaData().getTableForAlias(alias); if (tab != null) { Path tablePath = tab.getDataLocation(); if (tablePath != null) { if ("hdfs".equalsIgnoreCase(tablePath.toUri().getScheme())) { if (isPathEncrypted(tablePath)) { if (strongestPath == null) { strongestPath = tablePath; } else if (comparePathKeyStrength(tablePath, strongestPath) > 0) { strongestPath = tablePath; } } } } } } return strongestPath; }
/** * Retrieve skewed column name for a table. * @param alias table alias * @return */ public List<String> getSkewedColumnNames(String alias) { List<String> skewedColNames = null; if (null != qbm && null != qbm.getAliasToTable() && qbm.getAliasToTable().size() > 0) { Table tbl = getMetaData().getTableForAlias(alias); skewedColNames = tbl.getSkewedColNames(); } return skewedColNames; }
/** * Gets the strongest encrypted table path. * * @param qb The QB object that contains a list of all table locations. * @return The strongest encrypted path. It may return NULL if there are not tables encrypted, or are not HDFS tables. * @throws HiveException if an error occurred attempting to compare the encryption strength */ private Path getStrongestEncryptedTablePath(QB qb) throws HiveException { List<String> tabAliases = new ArrayList<String>(qb.getTabAliases()); Path strongestPath = null; /* Walk through all found table locations to get the most encrypted table */ for (String alias : tabAliases) { Table tab = qb.getMetaData().getTableForAlias(alias); if (tab != null) { Path tablePath = tab.getDataLocation(); if (tablePath != null) { if ("hdfs".equalsIgnoreCase(tablePath.toUri().getScheme())) { if (isPathEncrypted(tablePath)) { if (strongestPath == null) { strongestPath = tablePath; } else if (comparePathKeyStrength(tablePath, strongestPath) > 0) { strongestPath = tablePath; } } } } } } return strongestPath; }
Table target = qb.getMetaData().getDestTableForAlias(dest); Partition partition = target == null ? qb.getMetaData().getDestPartitionForAlias(dest) : null; throw new SemanticException(generateErrorMessage(selExprList, "Expected " + targetTableSchema.size() + " columns for " + dest + targetCol2Projection.put(targetCol, col_list.get(colListPos++)); Table target = qb.getMetaData().getDestTableForAlias(dest); Partition partition = target == null ? qb.getMetaData().getDestPartitionForAlias(dest) : null; if(target == null && partition == null) { throw new SemanticException(generateErrorMessage(selExprList, targetTableColTypes.add(TypeInfoUtils.getTypeInfoFromTypeString(fs.getType())); Map<String, String> partSpec = qb.getMetaData().getPartSpecForAlias(dest); if(partSpec != null) {
Table target = qb.getMetaData().getDestTableForAlias(dest); Partition partition = target == null ? qb.getMetaData().getDestPartitionForAlias(dest) : null; throw new SemanticException(generateErrorMessage(selExprList, "Expected " + targetTableSchema.size() + " columns for " + dest + targetCol2Projection.put(targetCol, col_list.get(colListPos++)); Table target = qb.getMetaData().getDestTableForAlias(dest); Partition partition = target == null ? qb.getMetaData().getDestPartitionForAlias(dest) : null; if(target == null && partition == null) { throw new SemanticException(generateErrorMessage(selExprList, targetTableColTypes.add(TypeInfoUtils.getTypeInfoFromTypeString(fs.getType())); Map<String, String> partSpec = qb.getMetaData().getPartSpecForAlias(dest); if(partSpec != null) {
Integer dest_type = qb.getMetaData().getDestTypeForAlias(dest); if(dest_type == QBMetaData.DEST_TABLE) { targetTable= qb.getMetaData().getDestTableForAlias(dest); Partition dest_part = qb.getMetaData().getDestPartitionForAlias(dest); targetTable = dest_part.getTable();
qb.getMetaData().setSrcForAlias(DUMMY_TABLE, getDummyTable()); qb.addAlias(DUMMY_TABLE); qb.setTabAlias(DUMMY_TABLE, DUMMY_TABLE);
qb.getMetaData().setSrcForAlias(DUMMY_TABLE, getDummyTable()); TableScanOperator op = (TableScanOperator) genTablePlan(DUMMY_TABLE, qb); op.getConf().setRowLimit(1);
Table dest_tab = qb.getMetaData().getDestTableForAlias(dest); AcidUtils.Operation acidOp = Operation.NOT_ACID; if (AcidUtils.isFullAcidTable(dest_tab)) {
Table tabMetaData = qb.getMetaData().getSrcForAlias(tableAlias);
Table tabMetaData = qb.getMetaData().getSrcForAlias(tableAlias);
Table tab = qb.getMetaData().getSrcForAlias(alias); RowResolver rwsch; colsEqual, alias, rwsch, qb.getMetaData(), null, tab.getBucketingVersion()); FilterDesc filterDesc = new FilterDesc( colsEqual, alias, rwsch, qb.getMetaData(), null, tab.getBucketingVersion()); FilterDesc filterDesc = new FilterDesc(samplePredicate, true); qb.getParseInfo().setTabSample(alias, tsSample); ExprNodeDesc samplePred = genSamplePredicate(tsSample, tab .getBucketCols(), true, alias, rwsch, qb.getMetaData(), null, tab.getBucketingVersion()); FilterDesc filterDesc = new FilterDesc(samplePred, true, .valueOf(460476415))); ExprNodeDesc samplePred = genSamplePredicate(tsSample, null, false, alias, rwsch, qb.getMetaData(), randFunc, tab.getBucketingVersion()); FilterDesc filterDesc = new FilterDesc(samplePred, true); filterDesc.setGenerated(true);
qb.getMetaData().setSrcForAlias(DUMMY_TABLE, getDummyTable()); TableScanOperator op = (TableScanOperator) genTablePlan(DUMMY_TABLE, qb); op.getConf().setRowLimit(1);
Table tab = qb.getMetaData().getSrcForAlias(alias); RowResolver rwsch; colsEqual, alias, rwsch, qb.getMetaData(), null); FilterDesc filterDesc = new FilterDesc( samplePredicate, true, new SampleDesc(ts.getNumerator(), colsEqual, alias, rwsch, qb.getMetaData(), null); FilterDesc filterDesc = new FilterDesc(samplePredicate, true); filterDesc.setGenerated(true); qb.getParseInfo().setTabSample(alias, tsSample); ExprNodeDesc samplePred = genSamplePredicate(tsSample, tab .getBucketCols(), true, alias, rwsch, qb.getMetaData(), null); FilterDesc filterDesc = new FilterDesc(samplePred, true, new SampleDesc(tsSample.getNumerator(), tsSample .valueOf(460476415))); ExprNodeDesc samplePred = genSamplePredicate(tsSample, null, false, alias, rwsch, qb.getMetaData(), randFunc); FilterDesc filterDesc = new FilterDesc(samplePred, true); filterDesc.setGenerated(true);
qb.getMetaData().setSrcForAlias(alias, tab); qb.getMetaData().setDestForAlias(name, ts.tableHandle); qb.getMetaData().setPartSpecForAlias(name, ts.partSpec); qb.getMetaData().setDestForAlias(name, ts.partHandle); qb.getMetaData().setDestForAlias(name, fname, isDfsFile);
qb.getMetaData().setSrcForAlias(alias, tab); qb.getMetaData().setDestForAlias(name, ts.tableHandle); qb.getMetaData().setPartSpecForAlias(name, ts.partSpec); qb.getMetaData().setDestForAlias(name, ts.partHandle); qb.getMetaData().setDestForAlias(name, fname, isDfsFile);
QBMetaData qbm = qb.getMetaData(); Integer dest_type = qbm.getDestTypeForAlias(dest);
QBMetaData qbm = qb.getMetaData(); Integer destType = qbm.getDestTypeForAlias(dest);
/** * Retrieve skewed column name for a table. * @param alias table alias * @return */ public List<String> getSkewedColumnNames(String alias) { List<String> skewedColNames = null; if (null != qbm && null != qbm.getAliasToTable() && qbm.getAliasToTable().size() > 0) { Table tbl = getMetaData().getTableForAlias(alias); skewedColNames = tbl.getSkewedColNames(); } return skewedColNames; }