How to use the catalog/dataCatalog.getChildren function in catalog

To help you get started, we’ve selected a few catalog examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cloudera / hue / desktop / core / src / desktop / js / sql / sqlUtils.js View on Github external
const findTable = tablesToGo => {
    if (tablesToGo.length === 0) {
      deferred.reject();
      return;
    }

    const nextTable = tablesToGo.pop();
    if (typeof nextTable.subQuery !== 'undefined') {
      findTable(tablesToGo);
      return;
    }

    cancellablePromises.push(
      dataCatalog
        .getChildren({
          sourceType: options.sourceType,
          namespace: options.namespace,
          compute: options.compute,
          path: identifierChainToPath(nextTable.identifierChain),
          cachedOnly: options && options.cachedOnly,
          cancellable: options && options.cancellable,
          temporaryOnly: options && options.temporaryOnly,
          silenceErrors: true
        })
        .done(childEntries => {
          let foundEntry = undefined;
          childEntries.some(childEntry => {
            if (identifierEquals(childEntry.name, options.identifierChain[0].name)) {
              foundEntry = childEntry;
              return true;
github cloudera / hue / desktop / core / src / desktop / js / jquery / plugins / jquery.hiveautocomplete.js View on Github external
$.when(self.namespaceDeferred, self.computeDeferred).done((namespace, compute) => {
          const target = path.pop();
          dataCatalog
            .getChildren({
              sourceType: self.options.apiHelperType,
              namespace: namespace,
              compute: compute,
              path: path
            })
            .done(childEntries => {
              if (
                childEntries.some(childEntry => {
                  return childEntry.name === target;
                })
              ) {
                onPathChange($el.val());
              }
            });
        });
github cloudera / hue / desktop / core / src / desktop / js / ko / bindings / ace / aceLocationHandler.js View on Github external
fetchChildren(identifierChain) {
    const self = this;
    const deferred = $.Deferred();
    dataCatalog
      .getChildren({
        sourceType: self.snippet.type(),
        namespace: self.snippet.namespace(),
        compute: self.snippet.compute(),
        temporaryOnly: self.snippet.autocompleteSettings.temporaryOnly,
        path: $.map(identifierChain, identifier => {
          return identifier.name;
        }),
        silenceErrors: true,
        cachedOnly: true
      })
      .done(deferred.resolve)
      .fail(() => {
        deferred.reject([]);
      });
    return deferred;
github cloudera / hue / desktop / core / src / desktop / js / ko / bindings / ace / aceLocationHandler.js View on Github external
const findIdentifierChainInTable = function(tablesToGo) {
          const nextTable = tablesToGo.shift();
          if (typeof nextTable.subQuery === 'undefined') {
            dataCatalog
              .getChildren({
                sourceType: self.snippet.type(),
                namespace: self.snippet.namespace(),
                compute: self.snippet.compute(),
                temporaryOnly: self.snippet.autocompleteSettings.temporaryOnly,
                path: $.map(nextTable.identifierChain, identifier => {
                  return identifier.name;
                }),
                cachedOnly: true,
                silenceErrors: true
              })
              .done(entries => {
                const containsColumn = entries.some(entry => {
                  return sqlUtils.identifierEquals(entry.name, location.identifierChain[0].name);
                });
github cloudera / hue / desktop / core / src / desktop / js / jquery / plugins / jquery.hiveautocomplete.js View on Github external
$.when(self.namespaceDeferred, self.computeDeferred).done((namespace, compute) => {
      dataCatalog
        .getChildren({
          sourceType: self.options.apiHelperType,
          namespace: namespace,
          compute: compute,
          path: []
        })
        .done(dbEntries => {
          callback(
            $.map(dbEntries, entry => {
              return entry.name;
            })
          );
        });
    });
  };