question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[OpenForce 2022] Modify capitalization of keywords in RAL grammar documents

See original GitHub issue

Hi community,

This issue is for https://github.com/apache/shardingsphere/discussions/12683#discussioncomment-2139441

Background

DistSQL(Distributed SQL)is Apache ShardingSphere specific SQL.

In documentation we usually use all uppercase words for grammar keywords and camel case for grammar variables. For example, in the syntax ADD RESOURCE dataSource, ADD and RESOURCE are syntax keywords, dataSource is variable

Aim

Modify grammar keywords in documents to uppercase.

The following files need to be modified

  • docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.en.md
  • docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/ral/_index.cn.md

How to

  1. Open the grammar document that needs to be modified
  2. Find the column that needs to be modified. The Statement column and Example in the table are the columns that need to be modified
  3. Identify syntax keywords.
    • Determined by the grammar definition file.

The grammar definition file is as follows

  • shardingsphere-distsql/shardingsphere-distsql-parser/src/main/antlr4/imports/RALStatement.g4
  • shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-distsql/shardingsphere-readwrite-splitting-distsql-parser/src/main/antlr4/imports/readwrite-splitting/RALStatement.g4
  • shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/sharding/RALStatement.g4
  • shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-distsql/shardingsphere-sharding-distsql-parser/src/main/antlr4/imports/scaling/RALStatement.g4

Example

Take modifying set readwrite_splitting hint source = [auto/write] as an example.

Search set readwrite_splitting hint source to determine the file where the grammar is located is shardingsphere-features/shardingsphere-readwrite-splitting/shardingsphere-readwrite-splitting-distsql/shardingsphere-readwrite-splitting-distsql-parser/src/main/antlr4/imports/ readwrite-splitting/RALStatement.g4.

The syntax is defined as SET READWRITE_SPLITTING HINT SOURCE EQ sourceValue .

So set readwrite_splitting hint source = [auto/write] should be changed to SET READWRITE_SPLITTING HINT SOURCE = [auto/write]

Example FYI

RAL::Global Rule

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:15 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
lanchengxcommented, Mar 31, 2022

@ritikBhandari it is wanted. I will merge your other PR soon

1reaction
ritikBhandaricommented, Mar 30, 2022

I guess cn means Chinese. Right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Openforce: Home
Our mission is to simplify onboarding, settlement, compliance and insurance for contracting companies and independent contractors through our ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found