Skip to content

About sort field of non-aggregation table sql statement #15

Closed

Description

@interma

In https://github.com/baidu/palo/blob/master/README.md:

In non-aggregation type of table, columns are not distinguished between dimensions and metrics, but should specify the sort columns in order to sort all rows. Palo will sort the table data according to the sort columns without any aggregation. The following figure gives an example of creating non-aggregation table.

-- Create non-aggregation table --
CREATE TABLE example_tbl (
    `date`      DATE,
    id          BIGINT,
    country     VARCHAR(32),
    click       BIGINT,
    cost        BIGINT
) DUPLICATE KEY(`date`, id, country)
DISTRIBUTED BY HASH(id) BUCKETS 32;

should specify the sort columns in order to sort all rows

Question:
where is the sort column in sql statement? I assumed it should be like:
date DATE Sort,
right? Is there something missing?

Activity

  1. imay commented on Aug 16, 2017

    @imay
    Contributor

    DUBPLICATE KEY is sort key, so data will sorted by (date, id, country)

  2. interma commented on Aug 16, 2017

    @interma
    MemberAuthor

    @imay thanks, clearly.

    PS:
    As we talked in wechat group, you can give a question label to this issue.

  3. imay commented on Aug 16, 2017

    @imay
    Contributor

    thanks for advise

  4. 166 remaining items

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions