You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2020/07/17 07:36:00 UTC

[GitHub] [cassandra] snazy commented on a change in pull request #669: CASSANDRA-15857 Preserve frozen in RawTuple toString

snazy commented on a change in pull request #669:
URL: https://github.com/apache/cassandra/pull/669#discussion_r456270200



##########
File path: test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
##########
@@ -66,24 +74,28 @@ public static void setup() throws Exception
         StorageService.instance.initServer();
     }
 
+    @Before
+    public void perTestSetup()
+    {
+        keyspace = "cql_keyspace" + idGen.incrementAndGet();
+        table = "table" + idGen.incrementAndGet();
+        qualifiedTable = keyspace + '.' + table;
+        File tempdir = Files.createTempDir();

Review comment:
       Think it's nicer to use a JUnit 4 `@Rule` here for `tempdir`:
   ``` 
       @Rule
       private TemporaryFolder tempFolder = new TemporaryFolder();
   ```

##########
File path: src/java/org/apache/cassandra/cql3/CQL3Type.java
##########
@@ -833,11 +835,7 @@ public boolean supportsFreezing()
             @Override
             public RawTuple freeze()
             {
-                List<CQL3Type.Raw> frozenTypes =
-                    types.stream()
-                         .map(t -> t.supportsFreezing() ? t.freeze() : t)
-                         .collect(toList());
-                return new RawTuple(frozenTypes, true);
+                return this;
             }
 
             public CQL3Type prepare(String keyspace, Types udts) throws InvalidRequestException

Review comment:
       Think you can simplify the `frozen` check in the first statement

##########
File path: test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
##########
@@ -66,24 +74,28 @@ public static void setup() throws Exception
         StorageService.instance.initServer();
     }
 
+    @Before
+    public void perTestSetup()
+    {
+        keyspace = "cql_keyspace" + idGen.incrementAndGet();
+        table = "table" + idGen.incrementAndGet();
+        qualifiedTable = keyspace + '.' + table;
+        File tempdir = Files.createTempDir();

Review comment:
       Otherwise a nice simplification!




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



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org