|
17 | 17 | */
|
18 | 18 | package org.apache.drill.exec.store.easy.json.loader;
|
19 | 19 |
|
20 |
| -import static org.junit.Assert.assertEquals; |
21 |
| -import static org.junit.Assert.assertNotNull; |
22 |
| -import static org.junit.Assert.assertNull; |
23 |
| -import static org.junit.Assert.assertTrue; |
24 |
| -import static org.junit.Assert.fail; |
25 |
| - |
26 | 20 | import org.apache.drill.categories.JsonTest;
|
27 | 21 | import org.apache.drill.common.exceptions.UserException;
|
28 | 22 | import org.apache.drill.common.types.TypeProtos.MinorType;
|
|
35 | 29 | import org.junit.Test;
|
36 | 30 | import org.junit.experimental.categories.Category;
|
37 | 31 |
|
| 32 | +import static org.junit.Assert.assertEquals; |
| 33 | +import static org.junit.Assert.assertNotNull; |
| 34 | +import static org.junit.Assert.assertNull; |
| 35 | +import static org.junit.Assert.assertTrue; |
| 36 | +import static org.junit.Assert.fail; |
| 37 | + |
38 | 38 | @Category(JsonTest.class)
|
39 | 39 | public class TestBasics extends BaseJsonLoaderTest {
|
40 | 40 |
|
@@ -176,12 +176,22 @@ public void testMissingEndOuterArray() {
|
176 | 176 |
|
177 | 177 | @Test
|
178 | 178 | public void testEmptyKey() {
|
179 |
| - expectError("{\"\": 10}", "does not allow empty keys"); |
| 179 | + JsonLoaderFixture loader = new JsonLoaderFixture(); |
| 180 | + loader.jsonOptions.skipMalformedRecords = true; |
| 181 | + loader.open("{\"\": 10}"); |
| 182 | + RowSet results = loader.next(); |
| 183 | + assertNotNull(results); |
| 184 | + assertEquals(1, results.rowCount()); |
180 | 185 | }
|
181 | 186 |
|
182 | 187 | @Test
|
183 | 188 | public void testBlankKey() {
|
184 |
| - expectError("{\" \": 10}", "does not allow empty keys"); |
| 189 | + JsonLoaderFixture loader = new JsonLoaderFixture(); |
| 190 | + loader.jsonOptions.skipMalformedRecords = true; |
| 191 | + loader.open("{\" \": 10}"); |
| 192 | + RowSet results = loader.next(); |
| 193 | + assertNotNull(results); |
| 194 | + assertEquals(1, results.rowCount()); |
185 | 195 | }
|
186 | 196 |
|
187 | 197 | @Test
|
|
0 commit comments