Skip to content

Struct property is not selected in Presto #7652

Closed

Description

@ErikJansenIRefact

Expected behavior

A struct property in a class should be retrieved in Presto when the topic is queried. Preferably as a nested object or otherwise as flattened properties.

Actual behavior

The property isn't selected at all.

Steps to reproduce

Create a class with a property of type LocalDate.
Add messages to a topic with JSON schema.
Select the topic in Presto.
It is expected that the property classified as LocalDate is returned (as a nested object).

When reading the message with Pulsar the message does contain the LocalDate property as an object.

Message id: 2535:2:-1:0
Message key: 1
Message value: {"orderNbr":1,"customerNbr":1,"orderStatus":"O","totalPrice":173665.47,"orderDate":{"year":1996,"month":"JANUARY","chronology":{"calendarType":"iso8601","id":"ISO"},"era":"CE","dayOfYear":2,"dayOfWeek":"TUESDAY","leapYear":true,"monthValue":1,"dayOfMonth":2},"orderPriority":"5-LOW","clerkNbr":"Clerk#000000951","shipPriority":0,"comment":"nstructions sleep furiously among "}
Message publish time: 1595580635827
Message event time: 1595580635773

When we select in Presto this is the result:

select * from pulsar."public/default"."order-json-key-date" where ordernbr=1;
 ordernbr | customernbr | orderstatus | totalprice | orderpriority |    clerknbr     | shippriority |              comment               | __partition__ |     __event_time__      |    __publish_time__     | __message_id__ | __seque
----------+-------------+-------------+------------+---------------+-----------------+--------------+------------------------------------+---------------+-------------------------+-------------------------+----------------+--------
        1 |           1 | O           |  173665.47 | 5-LOW         | Clerk#000000951 |            0 | nstructions sleep furiously among  |            -1 | 2020-07-24 10:50:35.773 | 2020-07-24 10:50:35.827 | (2535,2,0)     |        
(1 row)

The property "orderDate" is missing.

System configuration

Pulsar version: 2.6.0

Activity

  1. ErikJansenIRefact commented on Jul 24, 2020

    @ErikJansenIRefact
    Author

    Enclosed the code to reproduce.

    Archive.zip

  2. added
    area/sql
    type/bug
    on Jul 27, 2020
  3. added a commit that references this issue on Feb 1, 2021
    a1107ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/sqltype/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions