test_class.file: core/src/test/java/com/dtstack/flink/sql/util/TestDtStringUtil.java
test_class.identifier: TestDtStringUtil
test_case.body: @Test
      public void dealSqlCommentTest() {
          String testSQLWithComment = "CREATE TABLE MyTable --this is a comment\n";
          Assert.assertEquals("CREATE TABLE MyTable ", DtStringUtil.dealSqlComment(testSQLWithComment));
          testSQLWithComment = "CREATE TABLE 'MyTable--' --this is  a comment";
          Assert.assertEquals("CREATE TABLE 'MyTable--' ", DtStringUtil.dealSqlComment(testSQLWithComment));
          testSQLWithComment = "CREATE TABLE MyTable -- this is a '--comment'\n";
          Assert.assertEquals("CREATE TABLE MyTable ", DtStringUtil.dealSqlComment(testSQLWithComment));
      }
test_case.class_method_signature: TestDtStringUtil.dealSqlCommentTest()
test_case.full_signature: @Test public void dealSqlCommentTest()
test_case.identifier: dealSqlCommentTest
test_case.invocations: assertEquals dealSqlComment assertEquals dealSqlComment assertEquals dealSqlComment
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void dealSqlCommentTest()
focal_class.declarator: NO_VERSION_PATTERN = Pattern.compile("([a-zA-Z]+).*")
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern NO_VERSION_PATTERN = Pattern.compile("([a-zA-Z]+).*");
focal_class.type: Pattern
focal_class.var_name: NO_VERSION_PATTERN
focal_class.declarator: objectMapper = new ObjectMapper()
focal_class.modifier: private static
focal_class.original_string: private static ObjectMapper objectMapper = new ObjectMapper();
focal_class.type: ObjectMapper
focal_class.var_name: objectMapper
focal_class.file: core/src/main/java/com/dtstack/flink/sql/util/DtStringUtil.java
focal_class.identifier: DtStringUtil
focal_class.class_method_signature: DtStringUtil.splitIgnoreQuota(String str, char delimiter)
focal_class.full_signature: public static List<String> splitIgnoreQuota(String str, char delimiter)
focal_class.identifier: splitIgnoreQuota
focal_class.modifiers: public static
focal_class.parameters: (String str, char delimiter)
focal_class.return: List<String>
focal_class.signature: List<String> splitIgnoreQuota(String str, char delimiter)
focal_class.class_method_signature: DtStringUtil.splitField(String str)
focal_class.full_signature: public static List<String> splitField(String str)
focal_class.identifier: splitField
focal_class.modifiers: public static
focal_class.parameters: (String str)
focal_class.return: List<String>
focal_class.signature: List<String> splitField(String str)
focal_class.class_method_signature: DtStringUtil.replaceIgnoreQuota(String str, String oriStr, String replaceStr)
focal_class.full_signature: public static String replaceIgnoreQuota(String str, String oriStr, String replaceStr)
focal_class.identifier: replaceIgnoreQuota
focal_class.modifiers: public static
focal_class.parameters: (String str, String oriStr, String replaceStr)
focal_class.return: String
focal_class.signature: String replaceIgnoreQuota(String str, String oriStr, String replaceStr)
focal_class.class_method_signature: DtStringUtil.dealSqlComment(String sql)
focal_class.full_signature: public static String dealSqlComment(String sql)
focal_class.identifier: dealSqlComment
focal_class.modifiers: public static
focal_class.parameters: (String sql)
focal_class.return: String
focal_class.signature: String dealSqlComment(String sql)
focal_class.class_method_signature: DtStringUtil.col2string(Object column, String type)
focal_class.full_signature: public static String col2string(Object column, String type)
focal_class.identifier: col2string
focal_class.modifiers: public static
focal_class.parameters: (Object column, String type)
focal_class.return: String
focal_class.signature: String col2string(Object column, String type)
focal_class.class_method_signature: DtStringUtil.getPluginTypeWithoutVersion(String engineType)
focal_class.full_signature: public static String getPluginTypeWithoutVersion(String engineType)
focal_class.identifier: getPluginTypeWithoutVersion
focal_class.modifiers: public static
focal_class.parameters: (String engineType)
focal_class.return: String
focal_class.signature: String getPluginTypeWithoutVersion(String engineType)
focal_class.class_method_signature: DtStringUtil.addJdbcParam(String dbUrl, Map<String, String> addParams, boolean isForce)
focal_class.full_signature: public static String addJdbcParam(String dbUrl, Map<String, String> addParams, boolean isForce)
focal_class.identifier: addJdbcParam
focal_class.modifiers: public static
focal_class.parameters: (String dbUrl, Map<String, String> addParams, boolean isForce)
focal_class.return: String
focal_class.signature: String addJdbcParam(String dbUrl, Map<String, String> addParams, boolean isForce)
focal_class.class_method_signature: DtStringUtil.isJson(String str)
focal_class.full_signature: public static boolean isJson(String str)
focal_class.identifier: isJson
focal_class.modifiers: public static
focal_class.parameters: (String str)
focal_class.return: boolean
focal_class.signature: boolean isJson(String str)
focal_class.class_method_signature: DtStringUtil.parse(String str,Class clazz)
focal_class.full_signature: public static Object parse(String str,Class clazz)
focal_class.identifier: parse
focal_class.modifiers: public static
focal_class.parameters: (String str,Class clazz)
focal_class.return: Object
focal_class.signature: Object parse(String str,Class clazz)
focal_class.class_method_signature: DtStringUtil.firstUpperCase(String str)
focal_class.full_signature: public static String firstUpperCase(String str)
focal_class.identifier: firstUpperCase
focal_class.modifiers: public static
focal_class.parameters: (String str)
focal_class.return: String
focal_class.signature: String firstUpperCase(String str)
focal_class.class_method_signature: DtStringUtil.getTableFullPath(String schema, String tableName)
focal_class.full_signature: public static String getTableFullPath(String schema, String tableName)
focal_class.identifier: getTableFullPath
focal_class.modifiers: public static
focal_class.parameters: (String schema, String tableName)
focal_class.return: String
focal_class.signature: String getTableFullPath(String schema, String tableName)
focal_class.class_method_signature: DtStringUtil.rmStrQuote(String str)
focal_class.full_signature: public static String rmStrQuote(String str)
focal_class.identifier: rmStrQuote
focal_class.modifiers: public static
focal_class.parameters: (String str)
focal_class.return: String
focal_class.signature: String rmStrQuote(String str)
focal_class.class_method_signature: DtStringUtil.addQuoteForStr(String column)
focal_class.full_signature: public static String addQuoteForStr(String column)
focal_class.identifier: addQuoteForStr
focal_class.modifiers: public static
focal_class.parameters: (String column)
focal_class.return: String
focal_class.signature: String addQuoteForStr(String column)
focal_class.class_method_signature: DtStringUtil.getStartQuote()
focal_class.full_signature: public static String getStartQuote()
focal_class.identifier: getStartQuote
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getStartQuote()
focal_class.class_method_signature: DtStringUtil.getEndQuote()
focal_class.full_signature: public static String getEndQuote()
focal_class.identifier: getEndQuote
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getEndQuote()
focal_method.body: public static String dealSqlComment(String sql) {
          boolean inQuotes = false;
          boolean inSingleQuotes = false;
          int bracketLeftNum = 0;
          StringBuilder b = new StringBuilder(sql.length());
          char[] chars = sql.toCharArray();
          for (int index = 0; index < chars.length; index ++) {
              if (index == chars.length) {
                  return b.toString();
              }
              StringBuilder tempSb = new StringBuilder(2);
              if (index > 1) {
                  tempSb.append(chars[index - 1]);
                  tempSb.append(chars[index]);
              }
  
              if (tempSb.toString().equals("--")) {
                  if (inQuotes) {
                      b.append(chars[index]);
                  } else if (inSingleQuotes) {
                      b.append(chars[index]);
                  } else if (bracketLeftNum > 0) {
                      b.append(chars[index]);
                  } else {
                      b.deleteCharAt(b.length() - 1);
                      while (chars[index] != '\n') {
                          // 判断注释内容是不是行尾或者 sql 的最后一行
                          if (index == chars.length - 1) {
                              break;
                          }
                          index++;
                      }
                  }
              } else if (chars[index] == '\"' && '\\' != chars[index] && !inSingleQuotes) {
                  inQuotes = !inQuotes;
                  b.append(chars[index]);
              } else if (chars[index] == '\'' && '\\' != chars[index] && !inQuotes) {
                  inSingleQuotes = !inSingleQuotes;
                  b.append(chars[index]);
              } else {
                  b.append(chars[index]);
              }
          }
          return b.toString();
      }
focal_method.class_method_signature: DtStringUtil.dealSqlComment(String sql)
focal_method.full_signature: public static String dealSqlComment(String sql)
focal_method.identifier: dealSqlComment
focal_method.invocations: length toCharArray toString append append equals toString append append append deleteCharAt length append append append toString
focal_method.modifiers: public static
focal_method.parameters: (String sql)
focal_method.return: String
focal_method.signature: String dealSqlComment(String sql)