mirror of https://github.com/apache/cassandra
Improve json2sstable error reporting on nonexistent columns
patch by Paulo Motta; reviewed by Ariel Weisberg for CASSANDRA-10401
This commit is contained in:
parent
2548365a6e
commit
ff9b6bb973
|
|
@ -1,4 +1,5 @@
|
|||
2.1.12
|
||||
* Improve json2sstable error reporting on nonexistent columns (CASSANDRA-10401)
|
||||
* (cqlsh) fix COPY using wrong variable name for time_format (CASSANDRA-10633)
|
||||
* Do not run SizeEstimatesRecorder if a node is not a member of the ring (CASSANDRA-9912)
|
||||
* Improve handling of dead nodes in gossip (CASSANDRA-10298)
|
||||
|
|
|
|||
|
|
@ -281,6 +281,11 @@ public class SSTableImport
|
|||
*/
|
||||
public int importJson(String jsonFile, String keyspace, String cf, String ssTablePath) throws IOException
|
||||
{
|
||||
if (Schema.instance.getCFMetaData(keyspace, cf) == null)
|
||||
throw new IllegalArgumentException(String.format("Unknown keyspace/table %s.%s",
|
||||
keyspace,
|
||||
cf));
|
||||
|
||||
ColumnFamily columnFamily = ArrayBackedSortedColumns.factory.create(keyspace, cf);
|
||||
IPartitioner partitioner = DatabaseDescriptor.getPartitioner();
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,15 @@ import org.apache.cassandra.io.sstable.SSTableReader;
|
|||
|
||||
public class SSTableImportTest extends SchemaLoader
|
||||
{
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void testImportUnknownCf() throws IOException, URISyntaxException
|
||||
{
|
||||
// Import JSON to temp SSTable file
|
||||
String jsonUrl = resourcePath("SimpleCF.json");
|
||||
File tempSS = tempSSTableFile("Keyspace1", "Standard1");
|
||||
new SSTableImport(true).importJson(jsonUrl, "UnknownKeyspace", "UnknownCF", tempSS.getPath());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testImportSimpleCf() throws IOException, URISyntaxException
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue