Skip to main content

Class FilterByStringRequest

java.lang.Object
com.gpudb.protocol.FilterByStringRequest
All Implemented Interfaces:
org.apache.avro.generic.GenericContainer, org.apache.avro.generic.IndexedRecord

public class FilterByStringRequest extends Object implements org.apache.avro.generic.IndexedRecord
A set of parameters for GPUdb.filterByString.

Calculates which objects from a table or view match a string expression for the given string columns. Setting CASE_SENSITIVE can modify case sensitivity in matching for all modes except SEARCH. For SEARCH mode details and limitations, see Full Text Search.

  • Constructor Details

    • FilterByStringRequest

      public FilterByStringRequest()
      Constructs a FilterByStringRequest object with default parameters.
    • FilterByStringRequest

      public FilterByStringRequest(String tableName, String viewName, String expression, String mode, List<String> columnNames, Map<String,String> options)
      Constructs a FilterByStringRequest object with the specified parameters.
      Parameters:
      tableName - Name of the table on which the filter operation will be performed, in [schema_name.]table_name format, using standard name resolution rules. Must be an existing table or view.
      viewName - If provided, then this will be the name of the view containing the results, in [schema_name.]view_name format, using standard name resolution rules and meeting table naming criteria. Must not be an already existing table or view. The default value is ”.
      expression - The expression with which to filter the table.
      mode - The string filtering mode to apply. See below for details. Supported values:
      • SEARCH: Full text search query with wildcards and boolean operators. Note that for this mode, no column can be specified in columnNames; all string columns of the table that have text search enabled will be searched.
      • EQUALS: Exact whole-string match (accelerated).
      • CONTAINS: Partial substring match (not accelerated). If the column is a string type (non-charN) and the number of records is too large, it will return 0.
      • STARTS_WITH: Strings that start with the given expression (not accelerated). If the column is a string type (non-charN) and the number of records is too large, it will return 0.
      • REGEX: Full regular expression search (not accelerated). If the column is a string type (non-charN) and the number of records is too large, it will return 0.
      columnNames - List of columns on which to apply the filter. Ignored for SEARCH mode.
      options - Optional parameters.
      • CREATE_TEMP_TABLE: If TRUE, a unique temporary table name will be generated in the sys_temp schema and used in place of viewName. This is always allowed even if the caller does not have permission to create tables. The generated name is returned in QUALIFIED_VIEW_NAME. Supported values:The default value is FALSE.
      • COLLECTION_NAME: [DEPRECATED—please specify the containing schema for the view as part of viewName and use GPUdb.createSchema to create the schema if non-existent] Name of a schema for the newly created view. If the schema is non-existent, it will be automatically created.
      • CASE_SENSITIVE: If FALSE then string filtering will ignore case. Does not apply to SEARCH mode. Supported values:The default value is TRUE.
      The default value is an empty Map.
  • Method Details

    • getClassSchema

      public static org.apache.avro.Schema getClassSchema()
      This method supports the Avro framework and is not intended to be called directly by the user.
      Returns:
      The schema for the class.
    • getTableName

      public String getTableName()
      Name of the table on which the filter operation will be performed, in [schema_name.]table_name format, using standard name resolution rules. Must be an existing table or view.
      Returns:
      The current value of tableName.
    • setTableName

      public FilterByStringRequest setTableName(String tableName)
      Name of the table on which the filter operation will be performed, in [schema_name.]table_name format, using standard name resolution rules. Must be an existing table or view.
      Parameters:
      tableName - The new value for tableName.
      Returns:
      this to mimic the builder pattern.
    • getViewName

      public String getViewName()
      If provided, then this will be the name of the view containing the results, in [schema_name.]view_name format, using standard name resolution rules and meeting table naming criteria. Must not be an already existing table or view. The default value is ”.
      Returns:
      The current value of viewName.
    • setViewName

      public FilterByStringRequest setViewName(String viewName)
      If provided, then this will be the name of the view containing the results, in [schema_name.]view_name format, using standard name resolution rules and meeting table naming criteria. Must not be an already existing table or view. The default value is ”.
      Parameters:
      viewName - The new value for viewName.
      Returns:
      this to mimic the builder pattern.
    • getExpression

      public String getExpression()
      The expression with which to filter the table.
      Returns:
      The current value of expression.
    • setExpression

      public FilterByStringRequest setExpression(String expression)
      The expression with which to filter the table.
      Parameters:
      expression - The new value for expression.
      Returns:
      this to mimic the builder pattern.
    • getMode

      public String getMode()
      The string filtering mode to apply. See below for details. Supported values:
      • SEARCH: Full text search query with wildcards and boolean operators. Note that for this mode, no column can be specified in columnNames; all string columns of the table that have text search enabled will be searched.
      • EQUALS: Exact whole-string match (accelerated).
      • CONTAINS: Partial substring match (not accelerated). If the column is a string type (non-charN) and the number of records is too large, it will return 0.
      • STARTS_WITH: Strings that start with the given expression (not accelerated). If the column is a string type (non-charN) and the number of records is too large, it will return 0.
      • REGEX: Full regular expression search (not accelerated). If the column is a string type (non-charN) and the number of records is too large, it will return 0.
      Returns:
      The current value of mode.
    • setMode

      public FilterByStringRequest setMode(String mode)
      The string filtering mode to apply. See below for details. Supported values:
      • SEARCH: Full text search query with wildcards and boolean operators. Note that for this mode, no column can be specified in columnNames; all string columns of the table that have text search enabled will be searched.
      • EQUALS: Exact whole-string match (accelerated).
      • CONTAINS: Partial substring match (not accelerated). If the column is a string type (non-charN) and the number of records is too large, it will return 0.
      • STARTS_WITH: Strings that start with the given expression (not accelerated). If the column is a string type (non-charN) and the number of records is too large, it will return 0.
      • REGEX: Full regular expression search (not accelerated). If the column is a string type (non-charN) and the number of records is too large, it will return 0.
      Parameters:
      mode - The new value for mode.
      Returns:
      this to mimic the builder pattern.
    • getColumnNames

      public List<String> getColumnNames()
      List of columns on which to apply the filter. Ignored for SEARCH mode.
      Returns:
      The current value of columnNames.
    • setColumnNames

      public FilterByStringRequest setColumnNames(List<String> columnNames)
      List of columns on which to apply the filter. Ignored for SEARCH mode.
      Parameters:
      columnNames - The new value for columnNames.
      Returns:
      this to mimic the builder pattern.
    • getOptions

      public Map<String,String> getOptions()
      Optional parameters.
      • CREATE_TEMP_TABLE: If TRUE, a unique temporary table name will be generated in the sys_temp schema and used in place of viewName. This is always allowed even if the caller does not have permission to create tables. The generated name is returned in QUALIFIED_VIEW_NAME. Supported values:The default value is FALSE.
      • COLLECTION_NAME: [DEPRECATED—please specify the containing schema for the view as part of viewName and use GPUdb.createSchema to create the schema if non-existent] Name of a schema for the newly created view. If the schema is non-existent, it will be automatically created.
      • CASE_SENSITIVE: If FALSE then string filtering will ignore case. Does not apply to SEARCH mode. Supported values:The default value is TRUE.
      The default value is an empty Map.
      Returns:
      The current value of options.
    • setOptions

      public FilterByStringRequest setOptions(Map<String,String> options)
      Optional parameters.
      • CREATE_TEMP_TABLE: If TRUE, a unique temporary table name will be generated in the sys_temp schema and used in place of viewName. This is always allowed even if the caller does not have permission to create tables. The generated name is returned in QUALIFIED_VIEW_NAME. Supported values:The default value is FALSE.
      • COLLECTION_NAME: [DEPRECATED—please specify the containing schema for the view as part of viewName and use GPUdb.createSchema to create the schema if non-existent] Name of a schema for the newly created view. If the schema is non-existent, it will be automatically created.
      • CASE_SENSITIVE: If FALSE then string filtering will ignore case. Does not apply to SEARCH mode. Supported values:The default value is TRUE.
      The default value is an empty Map.
      Parameters:
      options - The new value for options.
      Returns:
      this to mimic the builder pattern.
    • getSchema

      public org.apache.avro.Schema getSchema()
      This method supports the Avro framework and is not intended to be called directly by the user.
      Specified by:
      getSchema in interface org.apache.avro.generic.GenericContainer
      Returns:
      The schema object describing this class.
    • get

      public Object get(int index)
      This method supports the Avro framework and is not intended to be called directly by the user.
      Specified by:
      get in interface org.apache.avro.generic.IndexedRecord
      Parameters:
      index - the position of the field to get
      Returns:
      value of the field with the given index.
      Throws:
    • put

      public void put(int index, Object value)
      This method supports the Avro framework and is not intended to be called directly by the user.
      Specified by:
      put in interface org.apache.avro.generic.IndexedRecord
      Parameters:
      index - the position of the field to set
      value - the value to set
      Throws:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object