cloudera / hue

Open source SQL Query Assistant service for Databases/Warehouses
https://cloudera.com
Apache License 2.0
1.17k stars 366 forks source link

Issue with auto-complete hue 4.5 #1041

Closed elisabetao closed 4 years ago

elisabetao commented 4 years ago

Hi,

Recently we started noticing some issues with the auto-complete on hue 4.5 and the JS error is: Uncaught (in promise) DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://machine:port/dynamic_bundle/workers/vendors~generic-parser~hive-parser~impala-parser-chunk-c4b642938a9e85d90ca6.js' failed to load. at https://machine:port/static/desktop/js/bundles/workers/sqlLocationWebWorker-bundle-c4b642938a9e85d90ca6.js:69:14 at async Promise.all (index 0) at async Promise.all (index 0)

Do you have any suggestions why this maybe happening?

Thanks a lot

romainr commented 4 years ago

Does it happen on CTRL + SPACE to autocomplete all the time? Any chance to try with 4.6 or master? Do you have it with http://demo.gethue.com/? (and I guess this is with the Impala editor?)

elisabetao commented 4 years ago

Salut Romain,

It seems to be related to the useradmin.superuser permissions.It occurs for those user who are missing those permissions. I am checking to code to see why this is happening.

Thanks a lot

romainr commented 4 years ago

Would they be missing the 'notebook/beeswax' permissions?

elisabetao commented 4 years ago

Hi

No, they already had all permissions with the exception of the useradmin/rwx (which normally they shouldn't have because they're not superusers), but if they don't have this permission the autocomplete does not work with the above JS error. "GET /dynamic_bundle/workers/hive-parser-chunk-9aaf83625b98a1cb26aa.js HTTP/1.1" (mem: 151mb)-- permission denied

elisabetao commented 4 years ago

Hi Romain,

I was wondering - are complex types parsing auto-complet expected to work correct;i in Hue 4.5?

thanks a lot

romainr commented 4 years ago

It should but maybe there are some corner cases not handled. Would you have the create table?

elisabetao commented 4 years ago

Hey,

The table looks something like this:

CREATE TABLE test(

2 | header struct<spaceid:string,appid:string,profileid:string,executor:string,executortype:string,createddate:string,eventtype:string>, 3 | customattributes struct<level:int,source:string>, 4 | enrichedattributes struct<env:string,name:string,kafkatopic:string,kafkapartition:int,kafkaoffset:bigint,eventid:string>) 5 | ROW FORMAT SERDE 6 | 'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 7 | STORED AS INPUTFORMAT 8 | 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 9 | OUTPUTFORMAT 10 | 'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'

Thanks a lot

JohanAhlen commented 4 years ago

Hi,

The table example above should work, for me the struct tree appear in the left assist and it suggest the nested fields with "SELECT customAttributes.| FROM test" (where | represents the cursor). Was there a particular query where you didn't get any suggestions?

It could be that the initial permission issue you describe was fixed with https://github.com/cloudera/hue/commit/51e6f329549f06233905fca40a0c3b20f27f5fb3

Cheers, Johan

elisabetao commented 4 years ago

Hi Johan,

Thanks so much fo rthe quick reply. Indeed, after applying https://github.com/cloudera/hue/commit/51e6f329549f06233905fca40a0c3b20f27f5fb3 to Hue 4.5 the auto-complete issue is fixed.

Kind regards, Elisabeta