You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2021/03/16 21:32:40 UTC

[GitHub] [gobblin] autumnust commented on a change in pull request #3246: [GOBBLIN-1412] Escape single backslash in avro ORC schema conversion

autumnust commented on a change in pull request #3246:
URL: https://github.com/apache/gobblin/pull/3246#discussion_r595529441



##########
File path: gobblin-utility/src/main/java/org/apache/gobblin/util/AvroUtils.java
##########
@@ -888,13 +888,13 @@ public static Path serializeAsPath(GenericRecord record, boolean includeFieldNam
   }
 
   /**
-   * Escaping ";" and "'" character in the schema string when it is being used in DDL.
+   * Escaping "\", """, ";" and "'" character in the schema string when it is being used in DDL.
    * These characters are not allowed to show as part of column name but could possibly appear in documentation field.
    * Therefore the escaping behavior won't cause correctness issues.
    */
   public static String sanitizeSchemaString(String schemaString) {
-    return schemaString.replace("\\\"", "\\\\\\\"").replace(";",  "\\;")
-        .replace("'", "\\'");
+    return schemaString.replace("\\\\", "\\\\\\\\").replace("\\\"", "\\\\\\\"")

Review comment:
       Actually, given the escaping of the single backslash, do we still need to escape the case when a backslash is followed by quote ? 




----------------------------------------------------------------
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:
users@infra.apache.org