/** * 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; }
/** * 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; }
private void gatherCTEReferences(QB qb, CTEClause current) throws HiveException { for (String alias : qb.getTabAliases()) { String tabName = qb.getTabNameForAlias(alias); String cteName = tabName.toLowerCase(); CTEClause cte = findCTEFromName(qb, cteName); if (cte != null) { if (ctesExpanded.contains(cteName)) { throw new SemanticException("Recursive cte " + cteName + " detected (cycle: " + StringUtils.join(ctesExpanded, " -> ") + " -> " + cteName + ")."); } cte.reference++; current.parents.add(cte); if (cte.qbExpr != null) { continue; } cte.qbExpr = new QBExpr(cteName); doPhase1QBExpr(cte.cteNode, cte.qbExpr, qb.getId(), cteName); ctesExpanded.add(cteName); gatherCTEReferences(cte.qbExpr, cte); ctesExpanded.remove(ctesExpanded.size() - 1); } } for (String alias : qb.getSubqAliases()) { gatherCTEReferences(qb.getSubqForAlias(alias), current); } }
private void gatherCTEReferences(QB qb, CTEClause current) throws HiveException { for (String alias : qb.getTabAliases()) { String tabName = qb.getTabNameForAlias(alias); String cteName = tabName.toLowerCase(); CTEClause cte = findCTEFromName(qb, cteName); if (cte != null) { if (ctesExpanded.contains(cteName)) { throw new SemanticException("Recursive cte " + cteName + " detected (cycle: " + StringUtils.join(ctesExpanded, " -> ") + " -> " + cteName + ")."); } cte.reference++; current.parents.add(cte); if (cte.qbExpr != null) { continue; } cte.qbExpr = new QBExpr(cteName); doPhase1QBExpr(cte.cteNode, cte.qbExpr, qb.getId(), cteName); ctesExpanded.add(cteName); gatherCTEReferences(cte.qbExpr, cte); ctesExpanded.remove(ctesExpanded.size() - 1); } } for (String alias : qb.getSubqAliases()) { gatherCTEReferences(qb.getSubqForAlias(alias), current); } }
for (String tableAlias : qb.getTabAliases()) { RelNode op = genTableLogicalPlan(tableAlias, qb); aliasToRel.put(tableAlias, op);
for (String alias : qb.getTabAliases()) { if(alias.equals(DUMMY_TABLE)) { continue;
for (String tableAlias : qb.getTabAliases()) { RelNode op = genTableLogicalPlan(tableAlias, qb); aliasToRel.put(tableAlias, op);
for (String alias : qb.getTabAliases()) { Operator op = genTablePlan(alias, qb); aliasToOpInfo.put(alias, op);
List<String> tabAliases = new ArrayList<String>(qb.getTabAliases());
List<String> tabAliases = new ArrayList<String>(qb.getTabAliases());
Set<String> tableAliases = qb.getTabAliases(); for (String alias : tableAliases) { try {
Set<String> tableAliases = qb.getTabAliases(); for (String alias : tableAliases) { try {
public String getAliasForTableName(String tableName) { for (String alias : qb.getTabAliases()) { String table = qb.getTabNameForAlias(alias); if (table != null && table.equalsIgnoreCase(tableName)) { return alias; } } // get alias from cubeTbls for (Map.Entry<String, AbstractCubeTable> cubeTblEntry : cubeTbls.entrySet()) { if (cubeTblEntry.getValue().getName().equalsIgnoreCase(tableName)) { return cubeTblEntry.getKey(); } } return tableName.toLowerCase(); }
public String getAliasForTableName(String tableName) { for (String alias : qb.getTabAliases()) { String table = qb.getTabNameForAlias(alias); if (table != null && table.equalsIgnoreCase(tableName)) { return alias; } } // get alias from cubeTbls for (Map.Entry<String, AbstractCubeTable> cubeTblEntry : cubeTbls.entrySet()) { if (cubeTblEntry.getValue().getName().equalsIgnoreCase(tableName)) { return cubeTblEntry.getKey(); } } return tableName.toLowerCase(); }
private void extractMetaTables() throws LensException { List<String> tabAliases = new ArrayList<String>(qb.getTabAliases()); Set<String> missing = new HashSet<String>(); for (String alias : tabAliases) { boolean added = addQueriedTable(alias); if (!added) { missing.add(alias); } } for (String alias : missing) { // try adding them as joinchains boolean added = addJoinChain(alias, false); if (!added) { log.info("Queried tables do not exist. Missing table:{}", alias); throw new LensException(LensCubeErrorCode.NEITHER_CUBE_NOR_DIMENSION.getLensErrorInfo()); } } }
private void extractMetaTables() throws LensException { List<String> tabAliases = new ArrayList<String>(qb.getTabAliases()); Set<String> missing = new HashSet<String>(); for (String alias : tabAliases) { boolean added = addQueriedTable(alias); if (!added) { missing.add(alias); } } for (String alias : missing) { // try adding them as joinchains boolean added = addJoinChain(alias, false); if (!added) { log.info("Queried tables do not exist. Missing table:{}", alias); throw new LensException(LensCubeErrorCode.NEITHER_CUBE_NOR_DIMENSION.getLensErrorInfo()); } } }
/** * 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; }
String targetDimAlias = cubeql.getQb().getTabAliases().iterator().next(); String targetDimTable = cubeql.getQb().getTabNameForAlias(targetDimAlias); if (targetDimTable == null) {
for (String alias : qb.getTabAliases()) { Operator op = genTablePlan(alias, qb); aliasToOpInfo.put(alias, op);
Set<String> tableAliases = qb.getTabAliases(); for (String alias : tableAliases) { try {