Tabnine Logo
CubeMetastoreClient.getAllDimensionTables
Code IndexAdd Tabnine to your IDE (free)

How to use
getAllDimensionTables
method
in
org.apache.lens.cube.metadata.CubeMetastoreClient

Best Java code snippets using org.apache.lens.cube.metadata.CubeMetastoreClient.getAllDimensionTables (Showing top 12 results out of 315)

origin: org.apache.lens/lens-cube

/**
 * Get all dimension tables of the dimension.
 *
 * @param dim Dimension object
 * @return List of fact tables
 * @throws LensException
 */
public List<CubeDimensionTable> getAllDimensionTables(Dimension dim) throws LensException {
 List<CubeDimensionTable> dimTables = new ArrayList<>();
 for (CubeDimensionTable dimTbl : getAllDimensionTables()) {
  if (dim == null || dimTbl.getDimName().equalsIgnoreCase(dim.getName().toLowerCase())) {
   dimTables.add(dimTbl);
  }
 }
 return dimTables;
}
origin: apache/lens

/**
 * Get all dimension tables of the dimension.
 *
 * @param dim Dimension object
 * @return List of fact tables
 * @throws LensException
 */
public List<CubeDimensionTable> getAllDimensionTables(Dimension dim) throws LensException {
 List<CubeDimensionTable> dimTables = new ArrayList<>();
 for (CubeDimensionTable dimTbl : getAllDimensionTables()) {
  if (dim == null || dimTbl.getDimName().equalsIgnoreCase(dim.getName().toLowerCase())) {
   dimTables.add(dimTbl);
  }
 }
 return dimTables;
}
origin: apache/lens

@Override
public List<String> getAllDimTableNames(LensSessionHandle sessionid, String dimensionName) throws LensException {
 try (SessionContext ignored = new SessionContext(sessionid)){
  CubeMetastoreClient client = getClient(sessionid);
  Dimension dimension = client.getDimension(dimensionName);
  if (dimensionName != null && dimension == null) {
   throw new LensException("Could not get table: " + dimensionName + " as a dimension");
  }
  Collection<CubeDimensionTable> dims = client.getAllDimensionTables(dimension);
  List<String> dimNames = new ArrayList<>(dims.size());
  for (CubeDimensionTable cdt : dims) {
   dimNames.add(cdt.getName());
  }
  return dimNames;
 }
}
origin: org.apache.lens/lens-cube

private void populateDimTables(Dimension dim, CubeQueryContext cubeql, boolean optional) throws LensException {
 if (cubeql.getCandidateDimTables().get(dim) != null) {
  return;
 }
 Set<CandidateDim> candidates = new HashSet<>();
 cubeql.getCandidateDimTables().put(dim, candidates);
 List<CubeDimensionTable> dimtables = cubeql.getMetastoreClient().getAllDimensionTables(dim);
 if (dimtables.isEmpty()) {
  if (!optional) {
   throw new LensException(LensCubeErrorCode.NO_CANDIDATE_DIM_AVAILABLE.getLensErrorInfo(),
       dim.getName().concat(" has no dimension tables"));
  } else {
   log.info("Not considering optional dimension {}  as, No dimension tables exist", dim);
   removeOptionalDimWithoutAlias(cubeql, dim);
  }
 }
 for (CubeDimensionTable dimtable : dimtables) {
  CandidateDim cdim = new CandidateDim(dimtable, dim);
  candidates.add(cdim);
 }
 log.info("Populated candidate dims: {} for {}", cubeql.getCandidateDimTables().get(dim), dim);
}
origin: apache/lens

private void populateDimTables(Dimension dim, CubeQueryContext cubeql, boolean optional) throws LensException {
 if (cubeql.getCandidateDimTables().get(dim) != null) {
  return;
 }
 Set<CandidateDim> candidates = new HashSet<>();
 cubeql.getCandidateDimTables().put(dim, candidates);
 List<CubeDimensionTable> dimtables = cubeql.getMetastoreClient().getAllDimensionTables(dim);
 if (dimtables.isEmpty()) {
  if (!optional) {
   throw new LensException(LensCubeErrorCode.NO_CANDIDATE_DIM_AVAILABLE.getLensErrorInfo(),
       dim.getName().concat(" has no dimension tables"));
  } else {
   log.info("Not considering optional dimension {}  as, No dimension tables exist", dim);
   removeOptionalDimWithoutAlias(cubeql, dim);
  }
 }
 for (CubeDimensionTable dimtable : dimtables) {
  CandidateDim cdim = new CandidateDim(dimtable, dim);
  candidates.add(cdim);
 }
 log.info("Populated candidate dims: {} for {}", cubeql.getCandidateDimTables().get(dim), dim);
}
origin: apache/lens

for (CubeDimensionTable dim : client.getAllDimensionTables()) {
 try(BufferedWriter bw = new BufferedWriter(new FileWriter(getClass()
   .getResource("/schema/dimtables").getPath()+"/"+dim.getName()+".xml"))) {
origin: apache/lens

assertTrue(client.isDimensionTable(cubeTbl));
List<CubeDimensionTable> tbls = client.getAllDimensionTables(countryDim);
boolean found = false;
for (CubeDimensionTable dim : tbls) {
origin: apache/lens

assertTrue(client.isDimensionTable(cubeTbl));
List<CubeDimensionTable> tbls = client.getAllDimensionTables(cityDim);
boolean found = false;
for (CubeDimensionTable dim : tbls) {
origin: apache/lens

assertTrue(cubeDim.equals(cubeDim2));
List<CubeDimensionTable> stateTbls = client.getAllDimensionTables(stateDim);
boolean found = false;
for (CubeDimensionTable dim : stateTbls) {
origin: apache/lens

assertTrue(client.isDimensionTable(cubeTbl));
List<CubeDimensionTable> tbls = client.getAllDimensionTables(zipDim);
boolean found = false;
for (CubeDimensionTable dim : tbls) {
origin: apache/lens

dimTable.alterColumn(new FieldSchema("testAddDim", "int", "test add column"));
List<CubeDimensionTable> tbls = client.getAllDimensionTables(zipDim);
boolean found = false;
for (CubeDimensionTable dim : tbls) {
origin: apache/lens

assertTrue(client.isDimensionTable(cubeTbl));
List<CubeDimensionTable> tbls = client.getAllDimensionTables(zipDim);
boolean found = false;
for (CubeDimensionTable dim : tbls) {
org.apache.lens.cube.metadataCubeMetastoreClientgetAllDimensionTables

Javadoc

Get all dimension tables in metastore

Popular methods of CubeMetastoreClient

  • getInstance
    Get the instance of CubeMetastoreClient corresponding to HiveConf
  • getHiveTable
    Get the hive Table corresponding to the name
  • createCubeDimensionTable
  • createStorage
  • getConf
    Get cube metastore client conf
  • addPartitions
    batch addition
  • alterCube
  • alterCubeDimensionTable
  • alterCubeFactTable
  • alterDimension
    Alter dimension specified by the dimension name to new definition
  • alterSegmentation
  • createCube
    Create cube in metastore defined by Cube or DerivedCube object
  • alterSegmentation,
  • createCube,
  • createDimension,
  • createSegmentation,
  • dropSegmentation,
  • dropStorageFromDim,
  • dropStorageFromFact,
  • getAllCubes,
  • getAllFacts

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • addToBackStack (FragmentTransaction)
  • startActivity (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • JFileChooser (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now