customer
order_details
_id
email_address
customer_name
and order_date
are both unquoted identifiers that refer to column names.
Operator | Description | Example |
---|---|---|
AND | Returns TRUE if both operands are TRUE. | KEY = ‘key1’ AND PROPERTIES[ROUTING] = ‘true’ |
OR | Returns TRUE if either operand is TRUE. | KEY = ‘key1’ OR KEY = ‘key2’ |
NOT | Returns TRUE if the operand is FALSE. | NOT KEY = ‘key1’ |
Operator | Description | Example | Result |
---|---|---|---|
= | Checks if the values of two operands are equal or not. | 1 = 2 | FALSE |
!= | Checks if the values of two operands are equal or not. | 1 != 2 | TRUE |
> | Checks if the value of the left operand is greater than the value of the right operand. | 1 > 2 | FALSE |
< | Checks if the value of the left operand is less than the value of the right operand. | 1 < 2 | TRUE |
>= | Checks if the value of the left operand is greater than or equal to the value of the right operand. | 1 >= 2 | FALSE |
<= | Checks if the value of the left operand is less than or equal to the value of the right operand. | 1 <= 2 | TRUE |
+
(unary plus)-
(unary minus)INT32
, INT64
, FLOAT
, DOUBLE
Output data type is the same as the input data type.
+
(addition)-
(subtraction)*
(multiplication)/
(division)%
(modulo)INT32
, INT64
, FLOAT
, DOUBLE
Output data type is following the precedence rules:
INT32
, the output data type is INT32
.INT64
, the output data type is INT64
.FLOAT
, the output data type is FLOAT
.DOUBLE
, the output data type is DOUBLE
.INT32
and the other operand is INT64
, the output data type is INT64
.INT32
and the other operand is FLOAT
, the output data type is FLOAT
.INT32
and the other operand is DOUBLE
, the output data type is DOUBLE
.INT64
and the other operand is FLOAT
, the output data type is FLOAT
.INT64
and the other operand is DOUBLE
, the output data type is DOUBLE
.FLOAT
and the other operand is DOUBLE
, the output data type is DOUBLE
.INT32
and INT64
operands. The output data type is the same as the input data type.
SELECT
, INSERT INTO
, and INSERT MULTI
. You can use a combination of them for routing, filtering, and projection purposes.
SELECT
statement is used to select data from a topic. It is the key statement of a pfSQL query to define the message scope and processing conditions.
Syntax scheme
WHERE
clause and OPTION
are optional.WHERE
clause allows you to define a set of conditions that the data needs to match in order to be returned. If you don’t want to add any conditions to limit your query results, you can skip it. For more information about the supported operators, see Logical/Boolean operators.OPTIONS
for specific use cases.
OPTIONS UNWRAP KEY
or OPTIONS UNWRAP VALUE
to unwrap the KeyValue schema, or OPTIONS MERGE
to merge the KeyValue schema into a single message.
For example, if you have a topic with KeyValue schema, and you want to query the key and value separately, you can use the following SQL:
UNWRAP KEY
, the SELECT statement only affects the message keys. Take the KeyValue<AVRO, AVRO>
message for example, SELECT * FROM \
topic` OPTIONS UNWRAP KEYonly selects the message key and ignores the message value. Similarly,
UNWRAP VALUE` takes the message value as the output message and ignores the key.OPTIONS
. Available configs are limited to the following:
processingGuarantees
cleanupSubscription
subscriptionPosition
deadLetterTopic
maxMessageRetries
retainOrdering
retainKeyOrdering
subName
subscriptionPosition
, subName
and cleanupSubscription
to pfSQL, you can use the following SQL:
INSERT INTO
routes messages from one topic to another, followed by a SELECT
statement to specify the data source with possible filtering/transformation conditions.
Syntax scheme
INSERT MULTI
routes messages from a topic to multiple ones based on specific criteria, followed by a SELECT
statement to specify the data source with possible filtering/transformation conditions.
Syntax scheme
CREATE SOURCE
statement to create a Pulsar source connector.
snctl
, pulsar-admin
, pulsarctl
, terraform
, or Cloud Console
to manage source connectors, CREATE SOURCE
is just another way to create source connectors.CREATE SINK
statement to create a Pulsa sink connector.
pulsar-admin
, pulsarctl
, terraform
, or Cloud Console
to manage sink connectors, CREATE SINK
is just another way to create sink connectors.SELECT
statement to transform messages, the generated messages use the same schema type as the input topic but with new schema info based on the transformation rules.
pfSQL currently supports the schema types of AVRO, JSON, and Key/Value when accessing the payload fields. Protobuf and Protobuf Native is not supported yet.