You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2023/01/03 06:47:09 UTC
[GitHub] [inlong] healchow commented on a diff in pull request #7122: [INLONG-7121][Sort] Repair bug for MongoDb parse flink sql
healchow commented on code in PR #7122:
URL: https://github.com/apache/inlong/pull/7122#discussion_r1060311394
##########
inlong-sort/sort-core/src/main/java/org/apache/inlong/sort/parser/impl/FlinkSqlParser.java:
##########
@@ -890,10 +910,13 @@ private String parseFields(List<FieldInfo> fields, Node node) {
* Generate primary key format in sql
*
* @param primaryKey The primary key of table
+ * @param filterPrimaryKey filter PrimaryKey, use for mongo
* @return Primary key format in sql
*/
- private String genPrimaryKey(String primaryKey) {
- if (StringUtils.isNotBlank(primaryKey)) {
+ private String genPrimaryKey(String primaryKey, String filterPrimaryKey) {
+ boolean checkPrimaryKeyFlag = StringUtils.isNotBlank(primaryKey)
+ && (StringUtils.isBlank(filterPrimaryKey) || !primaryKey.contains(filterPrimaryKey));
Review Comment:
Will there is problem using the `contains` method? For example, when primaryKey="global_id" and filterPrimaryKey="id".
--
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: commits-unsubscribe@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org