TherChenYang opened a new pull request, #29633:
URL: https://github.com/apache/shardingsphere/pull/29633

   Fixes #29177.
   
   Changes proposed in this pull request:
     - Support for parsing some SQL Server statements
     - Vistor sorts after parsing Projections
   
   Sql Case:
   ```sql
   INSERT INTO ContosoWarehouse.dbo.Affiliation
   SELECT * 
   FROM My_Lakehouse.dbo.Affiliation
   ```
   
   ```sql
   SELECT c.name AS column_name  
       ,c.column_id  
       ,SCHEMA_NAME(t.schema_id) AS type_schema  
       ,t.name AS type_name  
       ,t.is_user_defined  
       ,t.is_assembly_type  
       ,c.max_length  
       ,c.precision  
       ,c.scale  
   FROM sys.columns AS c   
   JOIN sys.types AS t ON c.user_type_id=t.user_type_id  
   WHERE c.object_id = OBJECT_ID('<schema_name.table_name>')  
   ORDER BY c.column_id
   ```
   ```sql
   SELECT OBJECT_NAME(object_id) AS referencing_object_name  
       ,COALESCE(COL_NAME(object_id, column_id), '(n/a)') AS 
referencing_column_name  
       ,*  
   FROM sys.sql_dependencies  
   WHERE referenced_major_id = OBJECT_ID('<schema_name.function_name>')  
   ORDER BY OBJECT_NAME(object_id), COL_NAME(object_id, column_id)
   ```
   
   ```sql
   SELECT SCHEMA_NAME(schema_id) AS schema_name  
       ,o.name AS object_name  
       ,o.type_desc  
       ,p.parameter_id  
       ,p.name AS parameter_name  
       ,TYPE_NAME(p.user_type_id) AS parameter_type  
       ,p.max_length  
       ,p.precision  
       ,p.scale  
       ,p.is_output  
   FROM sys.objects AS o  
   INNER JOIN sys.parameters AS p ON o.object_id = p.object_id  
   WHERE o.object_id = OBJECT_ID('<schema_name.object_name>')  
   ORDER BY schema_name, object_name, p.parameter_id
   ```
   
   ```sql
   SELECT name AS view_name   
     ,SCHEMA_NAME(schema_id) AS schema_name  
     ,OBJECTPROPERTYEX(object_id,'IsIndexed') AS IsIndexed  
     ,OBJECTPROPERTYEX(object_id,'IsIndexable') AS IsIndexable  
     ,create_date  
     ,modify_date  
   FROM sys.views
   ```
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following 
options:
   - [x] My code follows the [code of 
conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) 
of this project.
   - [x] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the 
pull request.
   - [x] I have passed maven check locally : `./mvnw clean install -B -T1C 
-Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [x] I have added corresponding unit tests for my changes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to