Class DropFlux

All Implemented Interfaces:
Expression, HasImports

public final class DropFlux extends AbstractParametrizedFlux
Drop will exclude specified columns from a table. See SPEC.

Options

  • columns - The list of columns which should be excluded from the resulting table. Cannot be used with fn. [array of strings]
  • fn - The function which takes a column name as a parameter and returns a boolean indicating whether or not the column should be excluded from the resulting table. Cannot be used with columns. [function(column)]

Example

 Flux flux = Flux
     .from("telegraf")
     .drop(new String[]{"host", "_measurement"});

 Flux flux = Flux
     .from("telegraf")
     .drop()
          .withFunction("column =~ /*free/");
 
Author:
Jakub Bednar (bednar@github) (02/08/2018 09:47)
  • Constructor Details

    • DropFlux

      public DropFlux(@Nonnull Flux source)
  • Method Details

    • operatorName

      @Nonnull protected String operatorName()
      Specified by:
      operatorName in class AbstractParametrizedFlux
      Returns:
      name of function
    • withColumns

      @Nonnull public DropFlux withColumns(@Nonnull String[] columns)
      Parameters:
      columns - The list of columns which should be excluded from the resulting table.
      Returns:
      this
    • withColumns

      @Nonnull public DropFlux withColumns(@Nonnull Collection<String> columns)
      Parameters:
      columns - The list of columns which should be excluded from the resulting table.
      Returns:
      this
    • withFunction

      @Nonnull public DropFlux withFunction(@Nonnull String function)
      Parameters:
      function - The function which takes a column name as a parameter and returns a boolean indicating whether or not the column should be excluded from the resulting table.
      Returns:
      this
    • collectImports

      public void collectImports(@Nonnull Set<String> collectedImports)
      Description copied from class: Flux
      Collects all imports of the flux.
      Overrides:
      collectImports in class Flux
      Parameters:
      collectedImports - a set to be filled by the used imports