[jira] [Created] (CALCITE-5106) Upgrade to Jekyll 4 and remove github-pages

2022-04-20 Thread Francis Chuang (Jira)
Francis Chuang created CALCITE-5106:
---

 Summary: Upgrade to Jekyll 4 and remove github-pages
 Key: CALCITE-5106
 URL: https://issues.apache.org/jira/browse/CALCITE-5106
 Project: Calcite
  Issue Type: Improvement
  Components: avatica, site
Reporter: Francis Chuang


While trying to build and preview the website locally for calcite and 
calcite-avatica, I noticed that the development mode feature for docker stopped 
working:
{{ Auto-regeneration: enabled for '/srv/jekyll'
/usr/gem/gems/jekyll-3.9.2/lib/jekyll/commands/serve/servlet.rb:3:in `require': 
cannot load such file -- webrick (LoadError)
from 
/usr/gem/gems/jekyll-3.9.2/lib/jekyll/commands/serve/servlet.rb:3:in `'
from /usr/gem/gems/jekyll-3.9.2/lib/jekyll/commands/serve.rb:184:in 
`require_relative'
from /usr/gem/gems/jekyll-3.9.2/lib/jekyll/commands/serve.rb:184:in 
`setup'
from /usr/gem/gems/jekyll-3.9.2/lib/jekyll/commands/serve.rb:102:in 
`process'
from /usr/gem/gems/jekyll-3.9.2/lib/jekyll/commands/serve.rb:93:in 
`block in start'
from /usr/gem/gems/jekyll-3.9.2/lib/jekyll/commands/serve.rb:93:in 
`each'
from /usr/gem/gems/jekyll-3.9.2/lib/jekyll/commands/serve.rb:93:in 
`start'
from /usr/gem/gems/jekyll-3.9.2/lib/jekyll/commands/serve.rb:75:in 
`block (2 levels) in init_with_program'
from /usr/gem/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in 
`block in execute'
from /usr/gem/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in 
`each'
from /usr/gem/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in 
`execute'
from /usr/gem/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
from /usr/gem/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
from /usr/gem/gems/jekyll-3.9.2/exe/jekyll:15:in `'
from /usr/local/bundle/bin/jekyll:27:in `load'
from /usr/local/bundle/bin/jekyll:27:in `'}}

This seems to be fixed in Jekyll 4.2.2 and 3.9.2, but the docker image we are 
using is only updating the 4.x versions: 
https://github.com/jekyll/jekyll/issues/8523

However, while trying to update Jekyll, I found it strange that Jekyll was 
pinned to 3.9.2 and could not be upgraded. Upon further investigation, it looks 
like github-pages gems locks us to Jekyll 3.9.2 and due to compatibility 
reasons for Github, they don't seem motivated to upgrade: 
https://github.com/github/pages-gem/issues/651

The github-pages gem creates an environment that mirrors the Github pages build 
environment. However, in our builds happen in a jekyll container in docker 
using Github actions, so it seems that github-page is not required.

This issue tracks upgrading to jekyll 4 and removing the github-pages gem for 
the calcite website.





--
This message was sent by Atlassian Jira
(v8.20.7#820007)


Build failed in Jenkins: Calcite » Calcite-snapshots #123

2022-04-20 Thread Apache Jenkins Server
See 


Changes:

[Francis Chuang] Remove instructions for syncing site and master and fix 
formatting issue in howto


--
[...truncated 281.25 KB...]
public  AssertThat doWithConnection(Function fn)
  ^
:1289:
 warning: no @param for fn
public  AssertThat doWithConnection(Function fn)
  ^
:1289:
 warning: no @return
public  AssertThat doWithConnection(Function fn)
  ^
:1289:
 warning: no @throws for java.lang.Exception
public  AssertThat doWithConnection(Function fn)
  ^
:1300:
 warning: no @param for fn
public final AssertThat doWithConnection(Consumer fn)
^
:1300:
 warning: no @return
public final AssertThat doWithConnection(Consumer fn)
^
:1300:
 warning: no @throws for java.lang.Exception
public final AssertThat doWithConnection(Consumer fn)
^
:1309:
 warning: no @param for 
public  AssertThat doWithDataContext(Function fn)
  ^
:1309:
 warning: no @param for fn
public  AssertThat doWithDataContext(Function fn)
  ^
:1309:
 warning: no @return
public  AssertThat doWithDataContext(Function fn)
  ^
:1309:
 warning: no @throws for java.lang.Exception
public  AssertThat doWithDataContext(Function fn)
  ^
:1322:
 warning: no @return
public Connection connect() throws SQLException {
  ^
:1322:
 warning: no @throws for java.sql.SQLException
public Connection connect() throws SQLException {
  ^
:1332:
 warning: no @return
public AssertThat pooled() {
  ^
:54:
 warning: no @return
  public static ConnectionFactory empty() {
  ^
:60:
 warning: no @param for connectionFactory
  public static ConnectionFactory pool(ConnectionFactory connectionFactory) {
  ^
100 warnings

> Task :plus:test
  2.1sec, org.apache.calcite.chinook.EndToEndTest > 
test(String)[3], [3] sql/functions.iq
  3.0sec, org.apache.calcite.chinook.EndToEndTest > 
test(String)[1], [1] sql/cross-join-lateral.iq
 13.1sec, org.apache.calcite.chinook.EndToEndTest > 
test(String)[4], [4] sql/basic.iq
  6.2sec, org.apache.calcite.chinook.EndToEndTest > 
test(String)[2], [2] sql/preferred-for-specific-user.iq
 16.8sec,4 completed,   0 failed,   0 skipped, test(String)
 16.9sec,4 completed,   0 failed,   0 skipped, 
org.apache.calcite.chinook.EndToEndTest

> Task :server:test FAILED
 11.2sec, 

Re: Calcite-Avatica-Go: Default branch renamed from master to main

2022-04-20 Thread Julian Hyde
Thanks, Francis. I followed those steps and they worked for me.

On Wed, Apr 20, 2022 at 7:17 PM Francis Chuang  wrote:
>
> Hey everyone,
>
> The default branch for the calcite-avatica-go repository has been
> renamed from master to main.
>
> For your local checked out copies of the repository, please do the
> following to migrate:
> 1. Ensure you are in the repository's folder in your command line.
> 2. Stash any uncommitted changes: git stash
> 3. Check out your local master branch: git checkout master
> 4. Rename your local master branch to main: git branch -m master main
> 5. Fetch latest commits and branches from remote: git fetch
> 6. Remove the tracking branch: git branch --unset-upstream
> 7. Create a new tracking branch (assuming the remote is called origin):
> git branch -u origin/main
> 8. Restore your uncommitted changes: git stash pop
>
> Francis


Calcite-Avatica-Go: Default branch renamed from master to main

2022-04-20 Thread Francis Chuang

Hey everyone,

The default branch for the calcite-avatica-go repository has been 
renamed from master to main.


For your local checked out copies of the repository, please do the 
following to migrate:

1. Ensure you are in the repository's folder in your command line.
2. Stash any uncommitted changes: git stash
3. Check out your local master branch: git checkout master
4. Rename your local master branch to main: git branch -m master main
5. Fetch latest commits and branches from remote: git fetch
6. Remove the tracking branch: git branch --unset-upstream
7. Create a new tracking branch (assuming the remote is called origin): 
git branch -u origin/main

8. Restore your uncommitted changes: git stash pop

Francis


[jira] [Created] (CALCITE-5105) Add MEASURE type and AGGREGATE aggregate function

2022-04-20 Thread Julian Hyde (Jira)
Julian Hyde created CALCITE-5105:


 Summary: Add MEASURE type and AGGREGATE aggregate function
 Key: CALCITE-5105
 URL: https://issues.apache.org/jira/browse/CALCITE-5105
 Project: Calcite
  Issue Type: Bug
Reporter: Julian Hyde


In CALCITE-4496 we propose adding measures to SQL, and an "AS MEASURE" 
sub-clause to the SELECT clause so that you can define measures. This change is 
a first step in that direction: namely the ability to define the columns are 
measures and use validate queries that use measures.

This change adds a {{MEASURE}} type, which is parameterized with the value 
type, so that in RelNode-and-RexNode-land a measure column whose value is of 
type {{INTEGER}} would have type {{MEASURE}}. (In SqlNode-land its 
type would be {{INTEGER}} and we would tell that it was a measure by some other 
means.)

This change also adds an aggregate function called {{AGGREGATE}} that evaluates 
measures in the current {{GROUP BY}} context. (You can think of this as letting 
the measures roll themselves up as only they know how. For example, if the 
{{sum_price}} measure is defined as {{SUM(price)}} then if I write 
{{AGGREGATE(sum_price)}} in my query it's as if I wrote {{SUM(price)}}. But we 
also support measures that have more complex formulas.)



--
This message was sent by Atlassian Jira
(v8.20.7#820007)


Re: History for unreleased versions being published to site

2022-04-20 Thread Francis Chuang
Great idea regarding commenting out the release notes! I think the 
instructions for releasing should also be updated to remind the RM that 
the release notes should be uncommented (if they were commented) when 
preparing a release as well.


On 21/04/2022 7:10 am, Julian Hyde wrote:

I pushed a commit to Avatica that comments out the release notes.

https://github.com/apache/calcite-avatica/commit/6de8d796b4c388f7c2019fff2c883b8b7909c97e
 


Julian



On Apr 20, 2022, at 1:23 PM, Michael Mior  wrote:

+1 Commented release notes seem to be an easy solution.

--
Michael Mior
mm...@apache.org


Le mer. 20 avr. 2022 à 10:00, Julian Hyde  a écrit :


Usually we don’t add release notes to history.md until the RC vote, so
this isn’t a problem.

But occasionally we want to start writing the rekease notes early. An
example is my recent change to upgrade Avatica’s gradle and Java. For such
changes we could add the release notes for the upcoming release commented
out, and the release manager could uncommon them when preparing the RC.

What you think?

Julian


On Apr 20, 2022, at 5:33 AM, Michael Mior  wrote:

I don't necessarily see this as a problem, although instead of

2022-MM-DD

for the release date, it might be nice to clearly indicate this is
unreleased.
--
Michael Mior
mm...@apache.org



Le mer. 20 avr. 2022 à 08:00, Francis Chuang 

a

écrit :

I noticed that some changes to Calcite's changelog was deployed to the
website automatically: https://calcite.apache.org/docs/history.html

The reason is that in the Github Actions workflow
(


https://github.com/apache/calcite/blob/master/.github/workflows/publish-non-release-website-updates.yml#L24
),


we deploy the site immediately when we update the history.md file. This
is because after a release, there's a possibility that we might need to
go back to update the release date or to make some small tweaks to the
changelog.

I was wondering if we can change history.md, so that the changelog for a
release is only visible if there's a release announcement in the _posts
folder, similar to how the downloads page is generated.

Would anyone familiar with jekyll like to take a stab at this?








Re: History for unreleased versions being published to site

2022-04-20 Thread Julian Hyde
I pushed a commit to Avatica that comments out the release notes.

https://github.com/apache/calcite-avatica/commit/6de8d796b4c388f7c2019fff2c883b8b7909c97e
 


Julian


> On Apr 20, 2022, at 1:23 PM, Michael Mior  wrote:
> 
> +1 Commented release notes seem to be an easy solution.
> 
> --
> Michael Mior
> mm...@apache.org
> 
> 
> Le mer. 20 avr. 2022 à 10:00, Julian Hyde  a écrit :
> 
>> Usually we don’t add release notes to history.md until the RC vote, so
>> this isn’t a problem.
>> 
>> But occasionally we want to start writing the rekease notes early. An
>> example is my recent change to upgrade Avatica’s gradle and Java. For such
>> changes we could add the release notes for the upcoming release commented
>> out, and the release manager could uncommon them when preparing the RC.
>> 
>> What you think?
>> 
>> Julian
>> 
>>> On Apr 20, 2022, at 5:33 AM, Michael Mior  wrote:
>>> 
>>> I don't necessarily see this as a problem, although instead of
>> 2022-MM-DD
>>> for the release date, it might be nice to clearly indicate this is
>>> unreleased.
>>> --
>>> Michael Mior
>>> mm...@apache.org
>>> 
>>> 
 Le mer. 20 avr. 2022 à 08:00, Francis Chuang 
>> a
 écrit :
 
 I noticed that some changes to Calcite's changelog was deployed to the
 website automatically: https://calcite.apache.org/docs/history.html
 
 The reason is that in the Github Actions workflow
 (
 
>> https://github.com/apache/calcite/blob/master/.github/workflows/publish-non-release-website-updates.yml#L24
>> ),
 
 we deploy the site immediately when we update the history.md file. This
 is because after a release, there's a possibility that we might need to
 go back to update the release date or to make some small tweaks to the
 changelog.
 
 I was wondering if we can change history.md, so that the changelog for a
 release is only visible if there's a release announcement in the _posts
 folder, similar to how the downloads page is generated.
 
 Would anyone familiar with jekyll like to take a stab at this?
 
>> 



Re: History for unreleased versions being published to site

2022-04-20 Thread Michael Mior
+1 Commented release notes seem to be an easy solution.

--
Michael Mior
mm...@apache.org


Le mer. 20 avr. 2022 à 10:00, Julian Hyde  a écrit :

> Usually we don’t add release notes to history.md until the RC vote, so
> this isn’t a problem.
>
> But occasionally we want to start writing the rekease notes early. An
> example is my recent change to upgrade Avatica’s gradle and Java. For such
> changes we could add the release notes for the upcoming release commented
> out, and the release manager could uncommon them when preparing the RC.
>
> What you think?
>
> Julian
>
> > On Apr 20, 2022, at 5:33 AM, Michael Mior  wrote:
> >
> > I don't necessarily see this as a problem, although instead of
> 2022-MM-DD
> > for the release date, it might be nice to clearly indicate this is
> > unreleased.
> > --
> > Michael Mior
> > mm...@apache.org
> >
> >
> >> Le mer. 20 avr. 2022 à 08:00, Francis Chuang 
> a
> >> écrit :
> >>
> >> I noticed that some changes to Calcite's changelog was deployed to the
> >> website automatically: https://calcite.apache.org/docs/history.html
> >>
> >> The reason is that in the Github Actions workflow
> >> (
> >>
> https://github.com/apache/calcite/blob/master/.github/workflows/publish-non-release-website-updates.yml#L24
> ),
> >>
> >> we deploy the site immediately when we update the history.md file. This
> >> is because after a release, there's a possibility that we might need to
> >> go back to update the release date or to make some small tweaks to the
> >> changelog.
> >>
> >> I was wondering if we can change history.md, so that the changelog for a
> >> release is only visible if there's a release announcement in the _posts
> >> folder, similar to how the downloads page is generated.
> >>
> >> Would anyone familiar with jekyll like to take a stab at this?
> >>
>


Re: [QUESTION] Window functions and Relational Operator Tree

2022-04-20 Thread Julian Hyde
It’s very interesting that you want to convert ZetaSQL to and from Calcite. I 
think other people will be interested in this. (It would help some of the 
things I am doing in my $dayjob at Google.) Would you consider contributing 
this as a new module in Calcite? Or creating a standalone project on GitHub?

Julian


> On Apr 20, 2022, at 12:27 PM, Miguel Hernández Sandoval 
>  wrote:
> 
> Hi everyone,
> I'm currently working on a converter from a ZetaSQL AST to a CalciteSQL
> Relational Operator Tree as part of a BeamSQL feature for Apache Beam.
> 
> Right now, I'm trying to build a Relational Operator Tree that represents a
> window function (e.g. "*select SUM(a) over(), COUNT(b) over() From T*").
> I've read this document[1] where it is explained how relational operators
> work in Calcite but it doesn't contain more details about Window or
> LogicalWindow.
> It could be useful to know what a tree of this kind of function should look
> like in order to choose an approach.
> 
> Could you give me some pointers on how to create a Relational Operator Tree
> that maps to a window function?
> Is there any other documentation you suggest?
> 
> Thank you all for your help.
> 
> [1] https://www.querifylabs.com/blog/relational-operators-in-apache-calcite
> 
> -- 
> 
> Miguel Hernández Sandoval | WIZELINE
> 
> Software Engineer
> 
> rogelio.hernan...@wizeline.com
> 
> Amado Nervo 2200, Esfera P6, Col. Jardines del Sol, 45050 Zapopan, Jal.
> 
> -- 
> *This email and its contents (including any attachments) are being sent to
> you on the condition of confidentiality and may be protected by legal
> privilege. Access to this email by anyone other than the intended recipient
> is unauthorized. If you are not the intended recipient, please immediately
> notify the sender by replying to this message and delete the material
> immediately from your system. Any further use, dissemination, distribution
> or reproduction of this email is strictly prohibited. Further, no
> representation is made with respect to any content contained in this email.*



Re: [QUESTION] Window functions and Relational Operator Tree

2022-04-20 Thread Gavin Ray
This might help:

https://github.com/apache/calcite/blob/e08ca8c5df5dee154ae1a1e6adfa2f9ce693ccf7/core/src/test/java/org/apache/calcite/plan/RelWriterTest.java#L570-L595

And it's JSON + text representations:

https://github.com/apache/calcite/blob/e08ca8c5df5dee154ae1a1e6adfa2f9ce693ccf7/core/src/test/java/org/apache/calcite/plan/RelWriterTest.java#L259-L377

https://github.com/apache/calcite/blob/e08ca8c5df5dee154ae1a1e6adfa2f9ce693ccf7/core/src/test/java/org/apache/calcite/plan/RelWriterTest.java#L677-L682

On Wed, Apr 20, 2022 at 3:27 PM Miguel Hernández Sandoval <
rogelio.hernan...@wizeline.com> wrote:

> Hi everyone,
> I'm currently working on a converter from a ZetaSQL AST to a CalciteSQL
> Relational Operator Tree as part of a BeamSQL feature for Apache Beam.
>
> Right now, I'm trying to build a Relational Operator Tree that represents a
> window function (e.g. "*select SUM(a) over(), COUNT(b) over() From T*").
> I've read this document[1] where it is explained how relational operators
> work in Calcite but it doesn't contain more details about Window or
> LogicalWindow.
> It could be useful to know what a tree of this kind of function should look
> like in order to choose an approach.
>
> Could you give me some pointers on how to create a Relational Operator Tree
> that maps to a window function?
> Is there any other documentation you suggest?
>
> Thank you all for your help.
>
> [1]
> https://www.querifylabs.com/blog/relational-operators-in-apache-calcite
>
> --
>
> Miguel Hernández Sandoval | WIZELINE
>
> Software Engineer
>
> rogelio.hernan...@wizeline.com
>
> Amado Nervo 2200, Esfera P6, Col. Jardines del Sol, 45050 Zapopan, Jal.
>
> --
> *This email and its contents (including any attachments) are being sent to
> you on the condition of confidentiality and may be protected by legal
> privilege. Access to this email by anyone other than the intended recipient
> is unauthorized. If you are not the intended recipient, please immediately
> notify the sender by replying to this message and delete the material
> immediately from your system. Any further use, dissemination, distribution
> or reproduction of this email is strictly prohibited. Further, no
> representation is made with respect to any content contained in this
> email.*
>


[QUESTION] Window functions and Relational Operator Tree

2022-04-20 Thread Miguel Hernández Sandoval
Hi everyone,
I'm currently working on a converter from a ZetaSQL AST to a CalciteSQL
Relational Operator Tree as part of a BeamSQL feature for Apache Beam.

Right now, I'm trying to build a Relational Operator Tree that represents a
window function (e.g. "*select SUM(a) over(), COUNT(b) over() From T*").
I've read this document[1] where it is explained how relational operators
work in Calcite but it doesn't contain more details about Window or
LogicalWindow.
It could be useful to know what a tree of this kind of function should look
like in order to choose an approach.

Could you give me some pointers on how to create a Relational Operator Tree
that maps to a window function?
Is there any other documentation you suggest?

Thank you all for your help.

[1] https://www.querifylabs.com/blog/relational-operators-in-apache-calcite

-- 

Miguel Hernández Sandoval | WIZELINE

Software Engineer

rogelio.hernan...@wizeline.com

Amado Nervo 2200, Esfera P6, Col. Jardines del Sol, 45050 Zapopan, Jal.

-- 
*This email and its contents (including any attachments) are being sent to
you on the condition of confidentiality and may be protected by legal
privilege. Access to this email by anyone other than the intended recipient
is unauthorized. If you are not the intended recipient, please immediately
notify the sender by replying to this message and delete the material
immediately from your system. Any further use, dissemination, distribution
or reproduction of this email is strictly prohibited. Further, no
representation is made with respect to any content contained in this email.*


Re: History for unreleased versions being published to site

2022-04-20 Thread Ruben Q L
+1 on Julian's proposal.


On Wed, Apr 20, 2022 at 3:00 PM Julian Hyde  wrote:

> Usually we don’t add release notes to history.md until the RC vote, so
> this isn’t a problem.
>
> But occasionally we want to start writing the rekease notes early. An
> example is my recent change to upgrade Avatica’s gradle and Java. For such
> changes we could add the release notes for the upcoming release commented
> out, and the release manager could uncommon them when preparing the RC.
>
> What you think?
>
> Julian
>
> > On Apr 20, 2022, at 5:33 AM, Michael Mior  wrote:
> >
> > I don't necessarily see this as a problem, although instead of
> 2022-MM-DD
> > for the release date, it might be nice to clearly indicate this is
> > unreleased.
> > --
> > Michael Mior
> > mm...@apache.org
> >
> >
> >> Le mer. 20 avr. 2022 à 08:00, Francis Chuang 
> a
> >> écrit :
> >>
> >> I noticed that some changes to Calcite's changelog was deployed to the
> >> website automatically: https://calcite.apache.org/docs/history.html
> >>
> >> The reason is that in the Github Actions workflow
> >> (
> >>
> https://github.com/apache/calcite/blob/master/.github/workflows/publish-non-release-website-updates.yml#L24
> ),
> >>
> >> we deploy the site immediately when we update the history.md file. This
> >> is because after a release, there's a possibility that we might need to
> >> go back to update the release date or to make some small tweaks to the
> >> changelog.
> >>
> >> I was wondering if we can change history.md, so that the changelog for a
> >> release is only visible if there's a release announcement in the _posts
> >> folder, similar to how the downloads page is generated.
> >>
> >> Would anyone familiar with jekyll like to take a stab at this?
> >>
>


Re: History for unreleased versions being published to site

2022-04-20 Thread Julian Hyde
Usually we don’t add release notes to history.md until the RC vote, so this 
isn’t a problem. 

But occasionally we want to start writing the rekease notes early. An example 
is my recent change to upgrade Avatica’s gradle and Java. For such changes we 
could add the release notes for the upcoming release commented out, and the 
release manager could uncommon them when preparing the RC. 

What you think?

Julian 

> On Apr 20, 2022, at 5:33 AM, Michael Mior  wrote:
> 
> I don't necessarily see this as a problem, although instead of 2022-MM-DD
> for the release date, it might be nice to clearly indicate this is
> unreleased.
> --
> Michael Mior
> mm...@apache.org
> 
> 
>> Le mer. 20 avr. 2022 à 08:00, Francis Chuang  a
>> écrit :
>> 
>> I noticed that some changes to Calcite's changelog was deployed to the
>> website automatically: https://calcite.apache.org/docs/history.html
>> 
>> The reason is that in the Github Actions workflow
>> (
>> https://github.com/apache/calcite/blob/master/.github/workflows/publish-non-release-website-updates.yml#L24),
>> 
>> we deploy the site immediately when we update the history.md file. This
>> is because after a release, there's a possibility that we might need to
>> go back to update the release date or to make some small tweaks to the
>> changelog.
>> 
>> I was wondering if we can change history.md, so that the changelog for a
>> release is only visible if there's a release announcement in the _posts
>> folder, similar to how the downloads page is generated.
>> 
>> Would anyone familiar with jekyll like to take a stab at this?
>> 


Re: History for unreleased versions being published to site

2022-04-20 Thread Michael Mior
I don't necessarily see this as a problem, although instead of 2022-MM-DD
for the release date, it might be nice to clearly indicate this is
unreleased.
--
Michael Mior
mm...@apache.org


Le mer. 20 avr. 2022 à 08:00, Francis Chuang  a
écrit :

> I noticed that some changes to Calcite's changelog was deployed to the
> website automatically: https://calcite.apache.org/docs/history.html
>
> The reason is that in the Github Actions workflow
> (
> https://github.com/apache/calcite/blob/master/.github/workflows/publish-non-release-website-updates.yml#L24),
>
> we deploy the site immediately when we update the history.md file. This
> is because after a release, there's a possibility that we might need to
> go back to update the release date or to make some small tweaks to the
> changelog.
>
> I was wondering if we can change history.md, so that the changelog for a
> release is only visible if there's a release announcement in the _posts
> folder, similar to how the downloads page is generated.
>
> Would anyone familiar with jekyll like to take a stab at this?
>


Re: History for unreleased versions being published to site

2022-04-20 Thread Francis Chuang
On a second though, the downside with this approach is that the change 
log will not be visible during a vote. Not sure if this is a blocker or 
if directing voters to read the change log on Github is okay.


On 20/04/2022 10:00 pm, Francis Chuang wrote:
I noticed that some changes to Calcite's changelog was deployed to the 
website automatically: https://calcite.apache.org/docs/history.html


The reason is that in the Github Actions workflow 
(https://github.com/apache/calcite/blob/master/.github/workflows/publish-non-release-website-updates.yml#L24), 
we deploy the site immediately when we update the history.md file. This 
is because after a release, there's a possibility that we might need to 
go back to update the release date or to make some small tweaks to the 
changelog.


I was wondering if we can change history.md, so that the changelog for a 
release is only visible if there's a release announcement in the _posts 
folder, similar to how the downloads page is generated.


Would anyone familiar with jekyll like to take a stab at this?


History for unreleased versions being published to site

2022-04-20 Thread Francis Chuang
I noticed that some changes to Calcite's changelog was deployed to the 
website automatically: https://calcite.apache.org/docs/history.html


The reason is that in the Github Actions workflow 
(https://github.com/apache/calcite/blob/master/.github/workflows/publish-non-release-website-updates.yml#L24), 
we deploy the site immediately when we update the history.md file. This 
is because after a release, there's a possibility that we might need to 
go back to update the release date or to make some small tweaks to the 
changelog.


I was wondering if we can change history.md, so that the changelog for a 
release is only visible if there's a release announcement in the _posts 
folder, similar to how the downloads page is generated.


Would anyone familiar with jekyll like to take a stab at this?


[jira] [Created] (CALCITE-5104) Select with CURRENT_DATE without alias produces alias that can't be parsed by Calcite itself

2022-04-20 Thread Vyacheslav Puzakov (Jira)
Vyacheslav Puzakov created CALCITE-5104:
---

 Summary: Select with CURRENT_DATE without alias produces alias 
that can't be parsed by Calcite itself
 Key: CALCITE-5104
 URL: https://issues.apache.org/jira/browse/CALCITE-5104
 Project: Calcite
  Issue Type: Bug
  Components: core
Affects Versions: 1.30.0
Reporter: Vyacheslav Puzakov


Validator configured with 
{code:java}
validatorConfig.withIdentifierExpansion(true){code}
In case of this original query:

 
{code:java}
select current_date from emp{code}
 

validator produces next sql node:

 
{code:java}
SELECT CURRENT_DATE AS CURRENT_DATE
FROM "CATALOG"."SALES"."EMP" AS "EMP"{code}
 

Where CURRENT_DATE used as simple *Alias*

If you try to parse that syntax, Calcite will fail with:

 
{code:java}
Caused by: org.apache.calcite.sql.parser.SqlParseException: Incorrect syntax 
near the keyword 'CURRENT_DATE' at line 1, column 24.
Was expecting one of:
     ...
     ...
     ...
     ...
     ...
     ...
     ...
     ...{code}
 

 

I tracked down a problem causing it:

SqlValidatorImpl.java

Line 435:

 
{code:java}
final String alias =
deriveAliasNonNull(
selectItem,
aliases.size()); {code}
produces "current_date" as alias

 

And then on the line 448 it applies:

 
{code:java}
expanded =
SqlStdOperatorTable.AS.createCall(
selectItem.getParserPosition(),
expanded,
new SqlIdentifier(alias, SqlParserPos.ZERO)); {code}
When this identifier *unparses* (SqlUtil.java)

 
{code:java}
public static void unparseSqlIdentifierSyntax(
...
final SqlOperator operator = isUnquotedSimple
? SqlValidatorUtil.lookupSqlFunctionByID(SqlStdOperatorTable.instance(), 
identifier, null)
: null;{code}
 

It finds that this identifier has *operator* as its *isUnquotedSimple* and 
putting it without quotes.

Possible solutions:
 # Change to SqlParserPos.QUOTED_ZERO which will produce valid syntax after 
unparsing, but will affect a lot results
in this case result will be (which parsed succesfully):

{code:java}
SELECT CURRENT_DATE AS "CURRENT_DATE"
FROM "CATALOG"."SALES"."EMP" AS "EMP"{code}

 #  A bit smarter move - check that this identifier is reserved keyword  
(function which parser can't handle in AS operator) and force quotes only in 
this case.

 

 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)