• Glossary
  • Support
  • Downloads
  • DataStax Home
Get Live Help
Expand All
Collapse All

DataStax Pulsar Connector

    • Getting Started
      • About the DataStax Apache Pulsar™ Connector
        • System requirements
      • Pulsar Connector release notes
      • Installing DataStax Apache Pulsar™ Connector
      • Pulsar Connector single instance quick start
    • Guides and examples
      • Configuration
        • Configuring parallelism
        • Specify writetime timestamp column
        • Setting row-level TTL values from Pulsar fields
        • Pass Pulsar Connector settings directly to the DataStax Java driver
        • Mapping pulsar topics to database tables
          • Determining topic data structure
          • Mapping basic messages to table columns
          • Mapping a message that contain JSON fields
            • Mapping a message that contains both basic and JSON fields
            • Mapping JSON messages
          • Mapping Avro messages
          • Extract Pulsar record header values
          • Mapping messages to table that has a User Defined Type
          • Mapping a topic to multiple tables
          • Multiple topics to multiple tables
          • Provide CQL queries in mappings
          • The now() function in mappings
      • Operations
        • About operating and maintaining the DataStax Connector
        • Scaling the DataStax Apache Pulsar™ Connector
        • Changing the topic or table schema
        • Restarting the DataStax Apache Pulsar™ Connector
        • Displaying the DataStax Apache Pulsar™ Connector configuration
        • Updating the DataStax Apache Pulsar™ Connector configuration
        • Deleting the DataStax Apache Pulsar™ Connector
        • Getting the DataStax Connector status
      • Security
        • Using internal or LDAP authentication
      • DataStax Apache Pulsar™ Connector metrics
      • Troubleshooting
        • Record fails to write
        • Writing fails because of mutation size
        • Data parsing fails
        • Loading balancing datacenter is not specified
    • Reference
      • DataStax Apache Pulsar™ Connector details
      • DataStax connection
      • Pulsar topic-to-table settings
      • Converting date and times for a topic
      • Using the DataStax Apache Pulsar™ Connector with DataStax Enterprise authentication
        • Internal or LDAP authentication
      • SSL encrypted connection
      • Configure error handling
  • DataStax Pulsar Connector
  • Reference
  • Converting date and times for a topic

Converting date and times for a topic

Use the following syntax to configure date and time conversion parameters for each Pulsar topic.

topic:
  topic_name:
    codec:
      locale: en_US
      timeZone: UTC
      timestamp: CQL_TIMESTAMP
      date: ISO_LOCAL_DATE
      time: ISO_LOCAL_TIME
      unit: MILLISECONDS

where topic_name is the name of the Apache Pulsar™ topic.

Parameters

Configure the date and time settings to override the default. These settings apply per topic.

Date and time settings support any public static field in java.time.format.DateTimeFormatter as an option.
timestamp

The temporal pattern to use for string-to-CQL timestamp conversion, the choices are:

  • Date-time pattern such as yyyy-MM-dd HH:mm:ss.

  • Pre-defined formatter such as ISO_ZONED_DATE_TIME or ISO_INSTANT.

  • Special formatter CQL_TIMESTAMP parser that accepts all valid CQL literal formats for the timestamp type.

    Default: CQL_TIMESTAMP

date

The temporal pattern to use for string-to-CQL date conversion.

  • Date-time pattern such as yyyy-MM-dd.

  • Pre-defined formatter such as ISO_LOCAL_DATE.

    Default: ISO_LOCAL_DATE

time

The temporal pattern to use for string-to-CQL time conversion. Valid choices:

  • Date-time pattern, such as HH:mm:ss.

  • Pre-defined formatter, such as ISO_LOCAL_TIME.

    Default: ISO_LOCAL_TIME

unit

If the input is a string containing only digits that cannot be parsed using the codec.timestamp format, the specified time unit is applied to the parsed value. All TimeUnit enum constants are valid choices.

Default: MILLISECONDS

timeZone

The time zone to use for temporal conversions that do not convey any explicit time zone information.

Default: UTC

locale

Locale to use for locale-sensitive conversions.

Default: en_US

See DateTimeFormatter documentation for additional options.

Examples

Timezone example

To write to a column with data type timestamp, for the test Pulsar topic string field that contains 2018-03-09T17:12:32.584+01:00[Europe/Paris], use the setting:

topic:
  test:
    codec:
      timestamp: ISO_ZONED_DATE_TIME

Date example

To write to a column with type date for a Pulsar topic that contains a string field like "2018-04-12", use the setting:

topic:
  test:
    codec:
      date: "yyyy-MM-dd"

Time example

To write to a column with type time for a Pulsar topic string field like "10:15:30", use setting:

topic:
  test:
    codec:
      time: ISO_LOCAL_TIME
Pulsar topic-to-table settings Using the DataStax Apache Pulsar™ Connector with DataStax Enterprise authentication

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

© DataStax | Privacy policy | Terms of use

DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.

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.

landing_page landingpage