You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Octopus ZHANG <zh...@gmail.com> on 2020/02/06 13:56:08 UTC

Failed to run example for JDBC

Hi all,


I fetched an example from the following link:
https://github.com/apache/calcite/blob/master/core/src/test/java/org/apache/calcite/examples/foodmart/java/JdbcExample.java

But I'm not able to run the code, it says cannot find
*"org.apache.calcite.examples.foodmart.java;
" *and it also shows several other errors. I also checked in the github
repository that the folder "examples" is missing.

Please see attach for the source file and the IDE screenshot (the error
message is in Chinese, but the red color shows the error line).

Thank you,

-- 
Yushan

Re: Failed to run example for JDBC

Posted by Octopus ZHANG <zh...@gmail.com>.
I read the docs but it seems somehow the Maven version doesn't contain the
require source code.

Thanks for your suggestion.


Vladimir Sitnikov <si...@gmail.com> 于2020年2月8日周六 下午10:57写道:

> >I uploaded the attachments to this link:
> >https://drive.google.com/open?id=1fH-qlXS59BYCj9JiYieTHVDk3GnioxX-
>
> Oh.
> It means you miss dependencies (jar files) required to compile and execute
> the code.
>
> I suggest you import Calcite source code (e.g. as explained here:
> https://calcite.apache.org/docs/howto.html#setting-up-intellij-idea )
> Then IDEA will see all the dependencies, and you will be able to execute
> examples.
>
> As you get familiar with the way Calcite feels, you might could create a
> standalone project that uses Calcite.
>
> Vladimir
>


-- 


Yushan

Re: Failed to run example for JDBC

Posted by Vladimir Sitnikov <si...@gmail.com>.
>I uploaded the attachments to this link:
>https://drive.google.com/open?id=1fH-qlXS59BYCj9JiYieTHVDk3GnioxX-

Oh.
It means you miss dependencies (jar files) required to compile and execute
the code.

I suggest you import Calcite source code (e.g. as explained here:
https://calcite.apache.org/docs/howto.html#setting-up-intellij-idea )
Then IDEA will see all the dependencies, and you will be able to execute
examples.

As you get familiar with the way Calcite feels, you might could create a
standalone project that uses Calcite.

Vladimir

Re: Failed to run example for JDBC

Posted by Octopus ZHANG <zh...@gmail.com>.
I used the newest version of Intellij on Windows 10 with JDK 11 to run the
code directly.

I uploaded the attachments to this link:
https://drive.google.com/open?id=1fH-qlXS59BYCj9JiYieTHVDk3GnioxX-


Michael Mior <mm...@apache.org> 于2020年2月6日周四 下午10:06写道:

> How were you trying to run the code? Note that the mailing list
> doesn't accept attachments, so you'll have to upload the screenshot
> somewhere and include a link. I'm not sure what you mean when you say
> the examples folder is missing from the repository. The link you
> included in your message is to a file in the examples folder.
> --
> Michael Mior
> mmior@apache.org
>
> Le jeu. 6 févr. 2020 à 08:56, Octopus ZHANG <zh...@gmail.com> a
> écrit :
> >
> > Hi all,
> >
> >
> > I fetched an example from the following link:
> >
> https://github.com/apache/calcite/blob/master/core/src/test/java/org/apache/calcite/examples/foodmart/java/JdbcExample.java
> >
> > But I'm not able to run the code, it says cannot find
> "org.apache.calcite.examples.foodmart.java; " and it also shows several
> other errors. I also checked in the github repository that the folder
> "examples" is missing.
> >
> > Please see attach for the source file and the IDE screenshot (the error
> message is in Chinese, but the red color shows the error line).
> >
> > Thank you,
> >
> > --
> > Yushan
> >
> >
> >
>


-- 


Yushan

Re: Failed to run example for JDBC

Posted by Rui Wang <am...@apache.org>.
Thanks Vladimir's reminder in Jira. It seems like Intellij on mac can just
run it without a problem, but the version on linux failed to run the main
class thus I thought there was a missing setup.


My PR then can be used as an example for those who's intellij somehow does
not work then.


-Rui

On Thu, Feb 6, 2020 at 1:01 PM Rui Wang <am...@apache.org> wrote:

> I tried to run this example but also got some troubles:
>
> 1. Intellij cannot run it directly.
> 2. "java -cp main_class" was not easy to use. Needed to add some jars to
> classpath and it eventually ended up with a "Class Not Found" error.
>
>
> So I create a gradle task for this example and then it can be as easy as
> just  running command "./gradlew runJdbcExample". Meanwhile it's also easy
> to let intellij run it by this command thus debugger becomes usable for
> inspecting what's going on under the execution of this example.
>
> see Jira [1] and PR [2]
>
>
> [1]: https://jira.apache.org/jira/browse/CALCITE-3776
> [2]: https://github.com/apache/calcite/pull/1789
>
>
> -Rui
>
>
>
> On Thu, Feb 6, 2020 at 6:06 AM Michael Mior <mm...@apache.org> wrote:
>
>> How were you trying to run the code? Note that the mailing list
>> doesn't accept attachments, so you'll have to upload the screenshot
>> somewhere and include a link. I'm not sure what you mean when you say
>> the examples folder is missing from the repository. The link you
>> included in your message is to a file in the examples folder.
>> --
>> Michael Mior
>> mmior@apache.org
>>
>> Le jeu. 6 févr. 2020 à 08:56, Octopus ZHANG <zh...@gmail.com> a
>> écrit :
>> >
>> > Hi all,
>> >
>> >
>> > I fetched an example from the following link:
>> >
>> https://github.com/apache/calcite/blob/master/core/src/test/java/org/apache/calcite/examples/foodmart/java/JdbcExample.java
>> >
>> > But I'm not able to run the code, it says cannot find
>> "org.apache.calcite.examples.foodmart.java; " and it also shows several
>> other errors. I also checked in the github repository that the folder
>> "examples" is missing.
>> >
>> > Please see attach for the source file and the IDE screenshot (the error
>> message is in Chinese, but the red color shows the error line).
>> >
>> > Thank you,
>> >
>> > --
>> > Yushan
>> >
>> >
>> >
>>
>

Re: Failed to run example for JDBC

Posted by Rui Wang <am...@apache.org>.
I tried to run this example but also got some troubles:

1. Intellij cannot run it directly.
2. "java -cp main_class" was not easy to use. Needed to add some jars to
classpath and it eventually ended up with a "Class Not Found" error.


So I create a gradle task for this example and then it can be as easy as
just  running command "./gradlew runJdbcExample". Meanwhile it's also easy
to let intellij run it by this command thus debugger becomes usable for
inspecting what's going on under the execution of this example.

see Jira [1] and PR [2]


[1]: https://jira.apache.org/jira/browse/CALCITE-3776
[2]: https://github.com/apache/calcite/pull/1789


-Rui



On Thu, Feb 6, 2020 at 6:06 AM Michael Mior <mm...@apache.org> wrote:

> How were you trying to run the code? Note that the mailing list
> doesn't accept attachments, so you'll have to upload the screenshot
> somewhere and include a link. I'm not sure what you mean when you say
> the examples folder is missing from the repository. The link you
> included in your message is to a file in the examples folder.
> --
> Michael Mior
> mmior@apache.org
>
> Le jeu. 6 févr. 2020 à 08:56, Octopus ZHANG <zh...@gmail.com> a
> écrit :
> >
> > Hi all,
> >
> >
> > I fetched an example from the following link:
> >
> https://github.com/apache/calcite/blob/master/core/src/test/java/org/apache/calcite/examples/foodmart/java/JdbcExample.java
> >
> > But I'm not able to run the code, it says cannot find
> "org.apache.calcite.examples.foodmart.java; " and it also shows several
> other errors. I also checked in the github repository that the folder
> "examples" is missing.
> >
> > Please see attach for the source file and the IDE screenshot (the error
> message is in Chinese, but the red color shows the error line).
> >
> > Thank you,
> >
> > --
> > Yushan
> >
> >
> >
>

Re: Failed to run example for JDBC

Posted by Michael Mior <mm...@apache.org>.
How were you trying to run the code? Note that the mailing list
doesn't accept attachments, so you'll have to upload the screenshot
somewhere and include a link. I'm not sure what you mean when you say
the examples folder is missing from the repository. The link you
included in your message is to a file in the examples folder.
--
Michael Mior
mmior@apache.org

Le jeu. 6 févr. 2020 à 08:56, Octopus ZHANG <zh...@gmail.com> a écrit :
>
> Hi all,
>
>
> I fetched an example from the following link:
> https://github.com/apache/calcite/blob/master/core/src/test/java/org/apache/calcite/examples/foodmart/java/JdbcExample.java
>
> But I'm not able to run the code, it says cannot find "org.apache.calcite.examples.foodmart.java; " and it also shows several other errors. I also checked in the github repository that the folder "examples" is missing.
>
> Please see attach for the source file and the IDE screenshot (the error message is in Chinese, but the red color shows the error line).
>
> Thank you,
>
> --
> Yushan
>
>
>