Github user ckadner commented on a diff in the pull request:
https://github.com/apache/spark/pull/7563#discussion_r36254686
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala
---
@@ -541,7 +541,7 @@ class HiveQuerySuite extends HiveComparisonTest with
BeforeAndAfter {
|('serialization.last.column.takes.rest'='true') USING 'cat' AS
(tKey, tValue)
|ROW FORMAT SERDE
'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
|WITH SERDEPROPERTIES
('serialization.last.column.takes.rest'='true') FROM src;
- """.stripMargin.replaceAll("\n", " "))
--- End diff --
Hi Michael,
I kept it at the test case level, since the rewrite is dependent on how the
String is constructed:
- the _simple string interpolator_ (`s"..."`) does not inject _carriage
return_ (`\r`) characters for line breaks even on Windows so we need to keep
using `\n` in the `replaceAll` function
- for _standard_ triple quoted Strings (`"""..."""`) across multiple lines
on Windows we end up with the `\r\n` line separators so here we need to use
`System.lineSeparator()` in the `replaceAll` function
I know this is not elegant nor self-explanatory but if I did the replace at
a higher level I would have to do a multi-step replacement and do some guess
work as to if a `\r` character is an artifact of an earlier `"
...\r\n...".replaceAll("\n", " ")` in which case I would just strip it, and
assume it was not intentionally introduced and it's not a line break on Mac
prior to OS X where I would have to replace it with a space (maybe)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]