yuqi1129 commented on issue #10150:
URL: https://github.com/apache/gravitino/issues/10150#issuecomment-3997322751

   I could not reproduce it locally. The following are the steps I adopt:
   
   ```shell
   
   ## Create a Iceberg catalog name `iceberg_catalog` under metalake `test1`
   
   #### Create database db3
   curl -X POST "http://localhost:9001/iceberg/v1/iceberg_catalog/namespaces"; \
        -H "Content-Type: application/json" \
        -d '{
              "namespace": ["db3"],
              "properties": {
              }
            }'
   
   #### create view under db3
   
   curl -X POST 
"http://localhost:9001/iceberg/v1/iceberg_catalog/namespaces/db3/views"; \
        -H "Content-Type: application/json" \
        -d '{
       "name": "test_view_1",
       "schema": {
           "type": "struct",
           "schema-id": 0,
           "fields": [
               {
                   "id": 1,
                   "name": "id",
                   "required": true,
                   "type": "int"
               },
               {
                   "id": 2,
                   "name": "data",
                   "required": false,
                   "type": "string"
               }
           ]
       },
       "view-version": {
           "version-id": 1,
           "timestamp-ms": 1772530509921,
           "schema-id": 0,
           "summary": {
               "operation": "create"
           },
           "representations": [
               {
                   "type": "sql",
                   "sql": "SELECT id, data FROM s1.source_table",
                   "dialect": "spark"
               }
           ],
           "default-namespace": [
               "s1"
           ]
       },
       "properties": {
           "comment": "Test view"
       }
   }'
   
   #### create user wangwu
   curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
   -H "Content-Type: application/json" -d '{
     "name": "wangwu"
   }' http://localhost:8090/api/metalakes/test1/users
   
   
   #### set wangwu as the owner of db3
   curl -X PUT -H "Accept: application/vnd.gravitino.v1+json" \
   -H "Content-Type: application/json" -d '{
       "name": "wangwu",
       "type": "USER"
   }' 
http://localhost:8090/api/metalakes/test1/owners/schema/iceberg_catalog.db3
   
   #### create a role
   
   curl -X POST -H "Accept: application/vnd.gravitino.v1+json" \
   -H "Content-Type: application/json" -d '{
      "name": "ircViewRole8b",
      "properties": {"k1": "v1"},
      "securableObjects": [
             {
                "fullName": "iceberg_catalog",
                "type": "CATALOG",
                "privileges": [
                       {
                            "name": "USE_CATALOG",
                            "condition": "ALLOW"
                       }
                ]    
             }
      ]
   }' http://localhost:8090/api/metalakes/test1/roles
   
   #### grant role to users
   curl -X PUT -H "Accept: application/vnd.gravitino.v1+json" \
   -H "Content-Type: application/json" -d '{
       "roleNames": ["ircViewRole8b"]
   }' http://localhost:8090/api/metalakes/test1/permissions/users/wangwu/grant
   
   
   #### update view with lisi
   
   curl -X POST 
"http://localhost:9001/iceberg/v1/iceberg_catalog/namespaces/db3/views/test_view_1";
 \
        -H "Content-Type: application/json" \
        -H "Authorization: Basic d2FuZ3d1Og==" \
        -d '{
       "requirements": [
           
       ],
       "updates": [
           {
               "action": "add-view-version",
               "view-version": {
                   "version-id": 2,
                   "timestamp-ms": 1772530530809,
                   "schema-id": 0,
                   "summary": {
                       "operation": "replace"
                   },
                   "representations": [
                       {
                           "type": "sql",
                           "sql": "SELECT id, data FROM s1.updated_table",
                           "dialect": "spark"
                       }
                   ],
                   "default-namespace": [
                       "s1"
                   ]
               }
           },
           {
               "action": "set-current-view-version",
               "view-version-id": 2
           }
       ]
   }'
   
   ```
   
   @danhuawang 
   Could you help check if there is anything I missed?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to