A representation of a table on a particular cluster.
A KuduTable holds the current schema of the table. Any given KuduTable object belongs to a specific KuduClient object.
Upon construction, the table is looked up in the catalog (or catalog cache), and the schema fetched for introspection.
This class is also a factory for write operation on the table. The provided operations are:
- INSERT Adds a new row. Fails if the row already exists.
- UPSERT Adds a new row. If there's an existing row, updates it.
- UPDATE Updates an existing row. Fails if the row does not exist.
- DELETE Deletes an existing row. Fails if the row does not exist.
- Note
- This class is thread-safe.
KuduPredicate * kudu::client::KuduTable::NewInBloomFilterPredicate |
( |
const Slice & |
col_name, |
|
|
const std::vector< Slice > & |
bloom_filters |
|
) |
| |
Create a new IN Bloom filter predicate using direct BlockBloomFilter pointers which can be used for scanners on this table.
A Bloom filter is a space-efficient probabilistic data structure used to test set membership with a possibility of false positive matches.
IN list predicate can be used with small number of values; on the other hand with IN Bloom filter predicate large number of values can be tested for membership in a space-efficient manner.
IN Bloom filter predicate may be automatically disabled if determined to be ineffective in filtering rows during scan requests.
Users are expected to perform further filtering to guard against false positives and automatic disablement of an ineffective Bloom filter predicate to get precise set membership information.
- Warning
- This method is experimental and may change or disappear in future.
- Parameters
-
[in] | col_name | Name of the column to which the predicate applies. |
| bloom_filters | Vector of BlockBloomFilter pointers that contain the values inserted to match against the column. The column value must match against all the supplied Bloom filters to be returned by the scanner. On return, regardless of success or error, the returned predicate will NOT take ownership of the pointers contained in bloom_filters and caller is responsible for the lifecycle management of the Bloom filters. The supplied Bloom filters are expected to remain valid for the lifetime of the KuduScanner. |
- Returns
- Raw pointer to an IN Bloom filter predicate. The caller owns the predicate until it is passed into KuduScanner::AddConjunctPredicate(). In the case of an error (e.g. an invalid column name), a non-NULL value is still returned. The error will be returned when attempting to add this predicate to a KuduScanner.
Create a new IN Bloom filter predicate which can be used for scanners on this table.
A Bloom filter is a space-efficient probabilistic data structure used to test set membership with a possibility of false positive matches. See KuduBloomFilter
for creating Bloom filters.
IN list predicate can be used with small number of values; on the other hand with IN Bloom filter predicate large number of values can be tested for membership in a space-efficient manner.
IN Bloom filter predicate may be automatically disabled if determined to be ineffective in filtering rows during scan requests.
Users are expected to perform further filtering to guard against false positives and automatic disablement of an ineffective Bloom filter predicate to get precise set membership information.
- Parameters
-
[in] | col_name | Name of the column to which the predicate applies. |
[in] | bloom_filters | Vector of Bloom filters that contain the values inserted to match against the column. The column value must match against all the supplied Bloom filters to be returned by the scanner. On return, regardless of success or error, the returned predicate will take ownership of the pointers contained in bloom_filters . |
- Returns
- Raw pointer to an IN Bloom filter predicate. The caller owns the predicate until it is passed into KuduScanner::AddConjunctPredicate(). In the case of an error (e.g. an invalid column name), a non-NULL value is still returned. The error will be returned when attempting to add this predicate to a KuduScanner.
Create a new IN list predicate which can be used for scanners on this table.
The IN list predicate is used to specify a list of values that a column must match. A row is filtered from the scan if the value of the column does not equal any value from the list.
The type of entries in the list must correspond to the type of the column to which the predicate is to be applied. For example, if the given column is any type of integer, the KuduValues should also be integers, with the values in the valid range for the column type. No attempt is made to cast between floating point and integer values, or numeric and string values.
- Parameters
-
[in] | col_name | Name of the column to which the predicate applies. |
[in] | values | Vector of values which the column will be matched against. |
- Returns
- Raw pointer to an IN list predicate. The caller owns the predicate until it is passed into KuduScanner::AddConjunctPredicate(). The returned predicate takes ownership of the values vector and its elements. In the case of an error (e.g. an invalid column name), a non-NULL value is still returned. The error will be returned when attempting to add this predicate to a KuduScanner.