Skip to content

new OlapTableSink without any partition may cause IllegalStateException #4620

@xinghuayu007

Description

@xinghuayu007

Describe the bug
In LoadingTaskPlanner#Plan(): OlapTableSink olapTableSink = new OlapTableSink(table, tupleDesc, partitionIds); If the table does not has any partition, Preconditions.checkState will throw IllegalStateException, but the funtion only cath UserException, that will cause load job status can not be updated。

To Reproduce
Steps to reproduce the behavior:

  1. create a table without partition:
    CREATE TABLE table1
    (
    event_day DATE,
    siteid INT DEFAULT '10',
    citycode SMALLINT,
    username VARCHAR(32) DEFAULT '',
    pv BIGINT SUM DEFAULT '0'
    )
    AGGREGATE KEY(event_day, siteid, citycode, username)
    PARTITION BY RANGE(event_day)()
    DISTRIBUTED BY HASH(siteid) BUCKETS 10
    PROPERTIES("replication_num" = "1");

  2. broker load job:
    LOAD LABEL db1.label1
    (
    DATA INFILE("hdfs://abc.com:8888/user/palo/test/ml/file1")
    INTO TABLE tbl1
    COLUMNS TERMINATED BY ","
    (event_date,siteid,citycode,username,pv)
    SET
    (
    date=event_date,
    id=siteid,
    code=citycode,
    name=username
    count=pv
    ),
    )
    WITH BROKER 'broker'
    (
    "username"="user",
    "password"="pass"
    )
    PROPERTIES
    (
    "timeout" = "3600"
    );

  3. error log:
    2020-09-17 20-08-42屏幕截图

  4. job status not be updated
    img_bec2b4ee-94de-4276-a4c2-6bfa87b4098l

Expected behavior
when IllegalStateException happed, job status should be updated to "CANCELLED"

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

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