/** * destination table : a table whose columns are getting queried intermediate table : a table * which is only used as a link between cube and destination table * * @param alias * @param tblName * @param isOptional pass false when it's a destination table pass true when it's an intermediate * table when join chain destination is being added, this will be false. * @param isChainedDimension pass true when you're adding the dimension as a joinchain * destination, pass false when this table is mentioned by name in the user query * @return true if added * @throws LensException */ private boolean addQueriedTable( String alias, String tblName, boolean isOptional, boolean isChainedDimension) throws LensException { alias = alias.toLowerCase(); if (cubeTbls.containsKey(alias)) { return true; } try { if (metastoreClient.isCube(tblName)) { if (cube != null) { if (!cube.getName().equalsIgnoreCase(tblName)) { throw new LensException( LensCubeErrorCode.MORE_THAN_ONE_CUBE.getLensErrorInfo(), cube.getName(), tblName); } } cube = metastoreClient.getCube(tblName); cubeTbls.put(alias, (AbstractCubeTable) cube); } else if (metastoreClient.isDimension(tblName)) { Dimension dim = metastoreClient.getDimension(tblName); if (!isOptional) { dimensions.add(dim); } if (!isChainedDimension) { nonChainedDimensions.add(dim); } cubeTbls.put(alias, dim); } else { return false; } } catch (HiveException e) { return false; } return true; }