Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add support for Query Hints for MS Fabric in TSql170Parser

Open
#180 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp, sql
Domain
compilers

Research direction

Start with the TSql170Parser entry point and the C# reproduction in the issue, using the Microsoft Fabric Query Hints examples as inputs. Trace the parser errors for FOR TIMESTAMP AS OF, FORCE SINGLE NODE PLAN, and FORCE DISTRIBUTED PLAN; done means all three examples parse without errors.

Written by the indexing model from the issue text.

Description

sqldw

We have encountered a parsing issue in Microsoft Documentation for MS Fabric Query Hints using TSql170Parser 170.128.0.

Examples
FOR TIMESTAMP AS OF

SELECT OrderDateKey, SUM(SalesAmount) AS TotalSales
FROM FactInternetSales
GROUP BY OrderDateKey
ORDER BY OrderDateKey
OPTION (FOR TIMESTAMP AS OF '2024-03-13T19:39:35.28');--March 13, 2024 at 7:39:35.28 PM UTC

Error Message : Incorrect syntax near 'FOR'.

Query force a single node or distributed query

SELECT OrderDateKey, SalesAmount
FROM FactInternetSales
OPTION (FORCE SINGLE NODE PLAN);

Error Message : Incorrect syntax near 'NODE'.

SELECT OrderDateKey, SalesAmount
FROM FactInternetSales
OPTION (FORCE DISTRIBUTED PLAN);

Error Message : Incorrect syntax near 'FORCE'.

Steps to reproduce

        static void Main(string[] args)
        {
            var script = @"<EXAMPLE_SCRIPT>";

            var parser = new TSql170Parser(true, 0);
            var fragment = parser.Parse(new StringReader(script), out var parseErrors);

            if (parseErrors.Count > 0)
            {
                Console.WriteLine(parseErrors[0].Message);
            }
        }
Dominant language
GAP
Stars
277
Forks
43
Avg merge
6d 17h
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/SqlScriptDOM

All issues in microsoft/SqlScriptDOM

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.