verdict-project / verdict

Interactive-Speed Analytics: 200x Faster, 200x Fewer Cluster Resources, Approximate Query Processing
http://verdictdb.org
Apache License 2.0
248 stars 66 forks source link

TypeError: 'JavaPackage' object is not callable #388

Open dmib opened 5 years ago

dmib commented 5 years ago

After the installing pyverdict with Miniconda - that error happened after launching app.

  File "C:\Workspace\Miniconda3\lib\site-packages\pyverdict\__init__.py", line 49, in redshift
    return redshift_context(host, port, dbname, user, password)
  File "C:\Workspace\Miniconda3\lib\site-packages\pyverdict\__init__.py", line 52, in redshift_context
    return VerdictContext.new_redshift_context(host, port, dbname, user, password)
  File "C:\Workspace\Miniconda3\lib\site-packages\pyverdict\verdictcontext.py", line 150, in new_redshift_context
    instance = cls(connection_string, user=user, password=password)
  File "C:\Workspace\Miniconda3\lib\site-packages\pyverdict\verdictcontext.py", line 70, in __init__
    verdictdbtempschema,
  File "C:\Workspace\Miniconda3\lib\site-packages\pyverdict\verdictcontext.py", line 340, in _get_context
    verdictdbtempschema,
  File "C:\Workspace\Miniconda3\lib\site-packages\pyverdict\verdictcontext.py", line 369, in _get_verdict_options
    verdict_options = gateway.jvm.org.verdictdb.commons.VerdictOption()

Env: Win10 C:\Workspace\Miniconda3\python.exe --version Python 3.7.3

row verdict_jar_path = self._get_verdict_jar_path() returns C:\Workspace\Miniconda3\lib\site-packages\pyverdict\verdict_jar\verdictdb-core-0.5.9-jar-with-dependencies.jar

but that code works: from py4j.java_gateway import JavaGateway gateway = JavaGateway.launch_gateway(classpath="C:\Workspace\Miniconda3\lib\site-packages\pyverdict\verdict_jar\verdictdb-core-0.5.9-jar-with-dependencies.jar") verdict_options = gateway.jvm.org.verdictdb.commons.VerdictOption() print(verdict_options) output: org.verdictdb.commons.VerdictOption@7bd716c9

erhuanlnna commented 1 year ago

I have also met such problem. The issue is because the automatically generatated classmath in verdictDB is designed for linux systems, where the multiple paths are connected by ":", instead of ";". In such case, directly using the JavaGateway.launch_gateway function will encounter the error. You can change the ":" as ";" in the verdictcontext.py file to ensure that the verdict_options instance can be successfully initialized.