Skip to content

[Enhancement](action) Support request the table schema of Non-OLAP table through http action#14518

Closed
weizuo93 wants to merge 1 commit intoapache:masterfrom
weizuo93:support-view-schema-action
Closed

[Enhancement](action) Support request the table schema of Non-OLAP table through http action#14518
weizuo93 wants to merge 1 commit intoapache:masterfrom
weizuo93:support-view-schema-action

Conversation

@weizuo93
Copy link
Contributor

Proposed changes

Issue Number: close #14517

Problem summary

This action is used to obtain the table structure information of the specified table.

curl -X GET -u xxx:xxx http://fe_host:http_port/api/{db}/{table}/_schema

But for Non-OLAP table, this action can not work such as view. For example:

{"msg":"Error","code":1,"data":"errCode = 7, detailMessage = table type is not OLAP, tableName=xxx, type=VIEW","count":0}

This patch is to support request the table schema of Non-OLAP table through this action.

Checklist(Required)

  1. Does it affect the original behavior:
    • Yes
    • No
    • I don't know
  2. Has unit tests been added:
    • Yes
    • No
    • No Need
  3. Has document been added or modified:
    • Yes
    • No
    • No Need
  4. Does it need to update dependencies:
    • Yes
    • No
  5. Are there any changes that cannot be rolled back:
    • Yes (If Yes, please explain WHY)
    • No

} catch (MetaNotFoundException e) {
catalog = Env.getCurrentEnv().getCatalogMgr().getCatalog(InternalCatalog.INTERNAL_CATALOG_NAME);
db = catalog.getDbOrAnalysisException(fullDbName);
table = db.getTableOrAnalysisException(tblName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use db.getTableOrMetaException(tblName)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stalary Thanks for your comment. This patch is to support querying doris view through spark, but there are some problems. I will close this PR.

@weizuo93 weizuo93 closed this Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Support request the table schema of Non-OLAP table through http action

2 participants