tristaZero commented on issue #8883:
URL: https://github.com/apache/shardingsphere/issues/8883#issuecomment-757729080


   Hi @lmhmhl ,
   
   I like your initiative to have deeper learning of ShardingSphere, which will 
help you play a more critical role in this community.
   
   You're right. Generally, it is supposed to get `ExecutionContext` from 
`ShardingSphereStatement`. However, currently, we just finish part of SQL 
federation function. #8284 still presents the progress of this great feature.
   Because of that, you can only get the correct `ExecutionContext` from 
`ShardingSphereStatement` for `single tables` (Not `sharding tables`) at 
present. 
   
   However, the target of this issue is to create UT for `CalciteJDBCExecutor`, 
which means we can focus on testing this executor runs the SQL from different 
database instances without caring which type this table is.
   
   Based on that, there are two options for you to finish this issue.
   - Get `ExecutionContext` from `ShardingSphereStatement` for `single tables` 
(configured with None sharding strategy)
   - Create `ExecutionContext` by yourself with `logic sql`
   
   Suppose you want to get my suggestion. I prefer the first one. The reason is 
that now you can **finish the workflow for** SQL federation applying to 
different types of tables. Currently, we can just test whether this 
`CalciteJDBCExecutor` works well for `single tables`. In the future, we can 
continue test on `sharding tables` only by adding a sharding table 
configuration in the `yaml` file (As we get `ExecutionContext` from 
`ShardingSphereStatement`).
   
   Do you think it is possible to cover what I said above? The key point here 
is to make sure your UT can test more tables by adding table rules in the 
configuration yaml file.
   
   If you like, you can still try to move #8284 forward. #8284 is a very 
significant feature for ShardingSphere, and it not a simple one. But no 
worries, I will provide any help you need. : )
   


----------------------------------------------------------------
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.

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


Reply via email to