sirily11 / secyan_gen_docs

secyan-gen-docs.vercel.app
0 stars 1 forks source link

Cannot generate code Cannot connect to the backend #1

Open psy-mas opened 3 years ago

psy-mas commented 3 years ago

Hi, thanks for making such an awesome library.

However, I encounter some troubles while testing it out. When I was trying to run a query from Query Editor, and It showed “Cannot generate code Cannot connect to the backend”

I've followed the docker installing instruction to compose up all the three containers needed in a Centos 7.8 server, including import data into the tpch-database.

When I was trying to run a query from Query Editor, and It showed “Cannot generate code Cannot connect to the backend”,

The Raw Data Configuration was: ''' [ { "annotations": [ "CAST(c_mktsegment = 'AUTOMOBILE' AS int)" ], "columns": [ { "column_type": "INT", "name": "n_nationkey" }, { "column_type": "STRING", "name": "n_name" }, { "column_type": "INT", "name": "n_regionkey" }, { "column_type": "STRING", "name": "n_comment" } ], "data_paths": [ "/usr/local/project/output_dir/nation.tbl" ], "data_sizes": [ 25 ], "table_name": "nation", "owner": "SERVER" } ] ''' and the query was : ''' SELECT * FROM nation; ''' Any suggestions? Looking foward for your replying.

Once again, thanks for making such an awesome library!!!

sirily11 commented 3 years ago

Hi. Thx for your feedback. The docker version of this library is still under some issues. I recommend using macOS for development and testing. However this repository is actively involved and we will fix the docker issues in the future.

psy-mas commented 3 years ago

Hi, thank you for the replying. I am testing the examples in the examples folder by successfully building the secyan-gen from source following your suggestion. The python_example_q3.py script can run successfully.

However, when I was running the auto_generate_example.py script, the result showed that : TypeError("Instance <Table: customer /> must be a type of PythonFreeConnexTab le but got type: <class 'codegen.table.free_connex_table.FreeConnexTable'>")).

Then I changed table type to PythonFreeConnexTable here, and the TypeError disapeared but got a empty result: (False, [['row_num', 'annotation'], ['Empty Relation']], {'name': 'customer', 'attributes': {'': '[]'}, 'children': []}, True, [])

Then I traced the running stack and found the data value in this line is : [{'Plan': {'Node Type': 'Seq Scan', 'Parallel Aware': False, 'Relation Name': 'nation', 'Alias': 'nation', 'Startup Cost': 0.0, 'Total Cost': 11.7, 'Plan Rows': 170, 'Plan Width': 434}}]

which means that the data[0][0]['Plan'].get('Plans', []) is [] in this line.

The above Plans value explains why the returned result is empty but I don't know how to run it normally and get a right result. Did I miss something or make some mistakes while testing ? Looking foward for your suggestions.

Thank you for the awesome library and your kind help !! Best wishes !!

sirily11 commented 3 years ago

Yeah. I will take a look at it and will fix this example bug in the next release. Stay around! Thx for your bug report!

psy-mas commented 3 years ago

Excellent!! Looking foward for the new release!! BTW, would you please explain what free-connex and free-connex table are ? I am really confused about that.

I appreciate for your kind help. Best wishes !!