Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to execute system_status script example via sql #2531

Closed
WenyXu opened this issue Oct 7, 2023 · 5 comments
Closed

Failed to execute system_status script example via sql #2531

WenyXu opened this issue Oct 7, 2023 · 5 comments
Labels
C-bug Category Bugs

Comments

@WenyXu
Copy link
Member

WenyXu commented Oct 7, 2023

What type of bug is this?

Unexpected error

What subsystems are affected?

Datanode

What happened?

Follow the doc, upload the system_status.py.

Execute sql select system_status();

However, it works via http (curl -XPOST \ "http://localhost:4000/v1/run-script?name=system_status&db=public")

What operating system did you use?

Ubuntu 23.04

Relevant log output and stack trace

2023-10-07T06:16:05.292265Z  WARN servers::mysql::server: Internal error occurred during query exec, server actively close the channel to let client try next time err=0: Other error, at src/servers/src/mysql/writer.rs:151:68
1: , at src/common/recordbatch/src/adapter.rs:203:55
2: External(0: Failed to execute Python UDF: 0: Coprocessor's Internal error: Can't find field name idc in all columns in RecordBatch { schema: Schema { column_schemas: [ColumnSchema { name: "host", data_type: Null(NullType), is_nullable: true, is_time_index: false, default_constraint: None, metadata: {} }], name_to_index: {"host": 0}, arrow_schema: Schema { fields: [Field { name: "host", data_type: Null, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }], metadata: {"greptime:version": "0"} }, timestamp_index: None, version: 0 }, columns: [ConstantVector([Null; 1])], df_record_batch: RecordBatch { schema: Schema { fields: [Field { name: "host", data_type: Null, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }], metadata: {"greptime:version": "0"} }, columns: [NullArray(1)], row_count: 1 } }, at src/script/src/python/ffi_types/copr.rs:221:50, at src/script/src/python/engine.rs:164:14)

How can we reproduce the bug?

Follows the doc, updates the system_status.py.

Executes sql select system_status();Follows the doc, updates the system_status.py.

Executes sql select system_status();Follows the doc, updates the system_status.py.

Executes sql select system_status();

@WenyXu WenyXu added the C-bug Category Bugs label Oct 7, 2023
@killme2008
Copy link
Contributor

Can't find field name idc in all columns in RecordBatch

You have to ensure the sysetm_metrics table was created.

@WenyXu
Copy link
Member Author

WenyXu commented Oct 7, 2023

Can't find field name idc in all columns in RecordBatch

You have to ensure the sysetm_metrics table was created.

I do have this table, it works via http

@killme2008
Copy link
Contributor

Got it, you mean execute it by SQL? It can't work, the result is expected.

If you want to call the python UDF in sql ,it must follow some rules.

@WenyXu
Copy link
Member Author

WenyXu commented Oct 7, 2023

Got it, you mean execute it by SQL? It can't work, the result is expected.

If you want to call the python UDF in sql ,it must follow some rules.

Ok, let's close it.

@WenyXu WenyXu closed this as completed Oct 7, 2023
@killme2008
Copy link
Contributor

Please create an issue in https://github.com/GreptimeTeam/docs

I will update the user guide to describe the rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category Bugs
Projects
None yet
Development

No branches or pull requests

2 participants