Specify writetime timestamp column

In the Apache Pulsar™ topic mapping, you can optionally specify which column should be used to note the timestamp when the Pulsar-produced record was inserted into any of the supported databases.

The mapping setting provides a special property, __timestamp. The format is:

topic:
  my_topic:
    my_ks:
      my_table:
        mapping: 'col1=key.f1, col2=value.f1, __timestamp=value.f2'

By default, the database internally tracks the writetime timestamp of records inserted from Pulsar. However, this __timestamp feature in the mapping supports the scenario where the Pulsar records have an explicit timestamp field that you want to use as a writetime for the database record produced by the connector.

The column value that you use must be a number.

When you map the __timestamp value, you may also want to specify the timeUnit of the provided timestamp. The default is MICROSECONDS. For example, if your column used as the timestamp is in a different format (for example SECONDS) set it to SECONDS. The connector will automatically transform it to the database’s proper numeric timestamp format; that is, to MICROSECONDS. Example:

topic:
  my_topic:
    my_ks:
      my_table:
        timestampTimeUnit: SECONDS

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com