apache / gravitino

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
https://gravitino.apache.org
Apache License 2.0
1.1k stars 345 forks source link

[Bug report] Iceberg tables always return empty property #907

Closed yuqi1129 closed 11 months ago

yuqi1129 commented 12 months ago

Describe what's wrong

When we create an Iceberg table with property

{
  "name": "iceberg_t1",
  "comment": "my test table",
  "columns": [
    {
      "name": "id",
      "type": "integer",
      "comment": "id column comment",
      "nullable": false
    },
    {
      "name": "name",
      "type": "string",
      "comment": "name column comment",
      "nullable": false
    }
  ],
  "properties": {
    "format-version": "1"
  }
}

and we try to load the tables.

curl -H "Content-Type: application/json"  http://localhost:8090/api/metalakes/test/catalogs/iceberg_catalog1/schemas/db_iceberg/tables/iceberg_t1

then we got an EMPTY property table

{
  "code": 0,
  "table": {
    "name": "iceberg_t1",
    "comment": "my test table",
    "columns": [
      {
        "name": "id",
        "type": "integer",
        "comment": "id column comment",
        "nullable": false
      },
      {
        "name": "name",
        "type": "string",
        "comment": "name column comment",
        "nullable": false
      }
    ],
    "properties": {},
    "audit": {
      "creator": "gravitino",
      "createTime": "2023-11-30T14:51:39.406177Z"
    },
    "distribution": {
      "strategy": "hash",
      "number": 0,
      "funcArgs": []
    },
    "sortOrders": [],
    "partitioning": []
  }
}

No response

Error message and/or stacktrace

No response

How to reproduce

➜  [/Users/yuqi/Downloads/package] curl -X POST -H "Content-Type: application/json" -d '{"name":"iceberg_t1","comment":"my test table","columns":[{"name":"id","type":"integer","comment":"id column comment","nullable":false},{"name":"name","type":"string","comment":"name column comment","nullable":false}],"properties":{"format-version":"1"}}' http://localhost:8090/api/metalakes/test/catalogs/iceberg_catalog1/schemas/db_iceberg/tables

{"code":0,"table":{"name":"iceberg_t1","comment":"my test table","columns":[{"name":"id","type":"integer","comment":"id column comment","nullable":false},{"name":"name","type":"string","comment":"name column comment","nullable":false}],"properties":{},"audit":{"creator":"gravitino","createTime":"2023-11-30T14:51:39.406177Z"},"distribution":{"strategy":"hash","number":0,"funcArgs":[]},"sortOrders":[],"partitioning":[]}}%
➜  [/Users/yuqi/Downloads/package]
➜  [/Users/yuqi/Downloads/package]
➜  [/Users/yuqi/Downloads/package] curl -H "Content-Type: application/json"  http://localhost:8090/api/metalakes/test/catalogs/iceberg_catalog1/schemas/db_iceberg/tables/iceberg_t1
{"code":0,"table":{"name":"iceberg_t1","comment":"my test table","columns":[{"name":"id","type":"integer","comment":"id column comment","nullable":false},{"name":"name","type":"string","comment":"name column comment","nullable":false}],"properties":{},"audit":{"creator":"gravitino","createTime":"2023-11-30T14:51:39.406177Z"},"distribution":{"strategy":"hash","number":0,"funcArgs":[]},"sortOrders":[],"partitioning":[]}}%
➜  [/Users/yuqi/Downloads/package]
➜  [/Users/yuqi/Downloads/package]
➜  [/Users/yuqi/Downloads/package]
➜  [/Users/yuqi/Downloads/package] curl -H "Content-Type: application/json"  http://localhost:8090/api/metalakes/test/catalogs/iceberg_catalog1/schemas/db_iceberg/tables/iceberg_t1
{"code":0,"table":{"name":"iceberg_t1","comment":"my test table","columns":[{"name":"id","type":"integer","comment":"id column comment","nullable":false},{"name":"name","type":"string","comment":"name column comment","nullable":false}],"properties":{},"audit":{"creator":"gravitino","createTime":"2023-11-30T14:51:39.406177Z"},"distribution":{"strategy":"hash","number":0,"funcArgs":[]},"sortOrders":[],"partitioning":[]}}%
➜  [/Users/yuqi/Downloads/package]

Additional context

No response

Clearvive commented 11 months ago

This is the expected result, and iceberg will not return the properties of the keyword in the properties