How to use the catalog/dataCatalog.getMultiTableEntry 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 / autocompleteResults.js View on Github external
handleAggregateFunctions() {
    const self = this;
    const aggregateFunctionsDeferred = $.Deferred();

    const suggestAggregateFunctions = self.parseResult.suggestAggregateFunctions;
    if (
      window.HAS_OPTIMIZER &&
      suggestAggregateFunctions &&
      suggestAggregateFunctions.tables.length > 0
    ) {
      initLoading(self.loadingAggregateFunctions, aggregateFunctionsDeferred);
      aggregateFunctionsDeferred.done(self.appendEntries);

      const paths = self.tableIdentifierChainsToPaths(suggestAggregateFunctions.tables);
      if (paths.length) {
        dataCatalog
          .getMultiTableEntry({
            sourceType: self.snippet.type(),
            namespace: self.snippet.namespace(),
            compute: self.snippet.compute(),
            paths: paths
          })
          .done(multiTableEntry => {
            self.cancellablePromises.push(
              multiTableEntry
                .getTopAggs({ silenceErrors: true, cancellable: true })
                .done(topAggs => {
                  const aggregateFunctionsSuggestions = [];
                  if (topAggs.values && topAggs.values.length > 0) {
                    // Expand all column names to the fully qualified name including db and table.
                    topAggs.values.forEach(value => {
                      value.aggregateInfo.forEach(info => {
github cloudera / hue / desktop / core / src / desktop / js / sql / autocompleteResults.js View on Github external
handleJoins() {
    const self = this;
    const joinsDeferred = $.Deferred();
    const suggestJoins = self.parseResult.suggestJoins;
    if (window.HAS_OPTIMIZER && suggestJoins) {
      initLoading(self.loadingJoins, joinsDeferred);
      joinsDeferred.done(self.appendEntries);

      const paths = self.tableIdentifierChainsToPaths(suggestJoins.tables);
      if (paths.length) {
        dataCatalog
          .getMultiTableEntry({
            sourceType: self.snippet.type(),
            namespace: self.snippet.namespace(),
            compute: self.snippet.compute(),
            paths: paths
          })
          .done(multiTableEntry => {
            self.cancellablePromises.push(
              multiTableEntry
                .getTopJoins({ silenceErrors: true, cancellable: true })
                .done(topJoins => {
                  const joinSuggestions = [];
                  let totalCount = 0;
                  if (topJoins.values) {
                    topJoins.values.forEach(value => {
                      let joinType = value.joinType || 'join';
github cloudera / hue / desktop / core / src / desktop / js / sql / autocompleteResults.js View on Github external
handleJoinConditions() {
    const self = this;
    const joinConditionsDeferred = $.Deferred();
    const suggestJoinConditions = self.parseResult.suggestJoinConditions;
    if (window.HAS_OPTIMIZER && suggestJoinConditions) {
      initLoading(self.loadingJoinConditions, joinConditionsDeferred);
      joinConditionsDeferred.done(self.appendEntries);

      const paths = self.tableIdentifierChainsToPaths(suggestJoinConditions.tables);
      if (paths.length) {
        dataCatalog
          .getMultiTableEntry({
            sourceType: self.snippet.type(),
            namespace: self.snippet.namespace(),
            compute: self.snippet.compute(),
            paths: paths
          })
          .done(multiTableEntry => {
            self.cancellablePromises.push(
              multiTableEntry
                .getTopJoins({ silenceErrors: true, cancellable: true })
                .done(topJoins => {
                  const joinConditionSuggestions = [];
                  let totalCount = 0;
                  if (topJoins.values) {
                    topJoins.values.forEach(value => {
                      if (value.joinCols.length > 0) {
github cloudera / hue / desktop / core / src / desktop / js / sql / autocompleteResults.js View on Github external
handleFilters() {
    const self = this;
    const filtersDeferred = $.Deferred();
    const suggestFilters = self.parseResult.suggestFilters;
    if (window.HAS_OPTIMIZER && suggestFilters) {
      initLoading(self.loadingFilters, filtersDeferred);
      filtersDeferred.done(self.appendEntries);

      const paths = self.tableIdentifierChainsToPaths(suggestFilters.tables);
      if (paths.length) {
        dataCatalog
          .getMultiTableEntry({
            sourceType: self.snippet.type(),
            namespace: self.snippet.namespace(),
            compute: self.snippet.compute(),
            paths: paths
          })
          .done(multiTableEntry => {
            self.cancellablePromises.push(
              multiTableEntry
                .getTopFilters({ silenceErrors: true, cancellable: true })
                .done(topFilters => {
                  const filterSuggestions = [];
                  let totalCount = 0;
                  if (topFilters.values) {
                    topFilters.values.forEach(value => {
                      if (