org.apache.flink.formats.avro.utils.AvroTestUtils Java Examples
The following examples show how to use
org.apache.flink.formats.avro.utils.AvroTestUtils.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testGenericSerializeSeveralTimes() throws IOException { final Tuple3<GenericRecord, Row, Schema> testData = AvroTestUtils.getGenericTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f2.toString()); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f2.toString()); serializationSchema.serialize(testData.f1); serializationSchema.serialize(testData.f1); final byte[] bytes = serializationSchema.serialize(testData.f1); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f1, actual); }
Example #2
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSerializability() throws Exception { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); // from class final AvroRowSerializationSchema classSer = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema classDeser = new AvroRowDeserializationSchema(testData.f0); testSerializability(classSer, classDeser, testData.f2); // from schema string final AvroRowSerializationSchema schemaSer = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema schemaDeser = new AvroRowDeserializationSchema(schemaString); testSerializability(schemaSer, schemaDeser, testData.f2); }
Example #3
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testGenericDeserializeSeveralTimes() throws IOException { final Tuple3<GenericRecord, Row, Schema> testData = AvroTestUtils.getGenericTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f2.toString()); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f2.toString()); final byte[] bytes = serializationSchema.serialize(testData.f1); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f1, actual); }
Example #4
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificDeserializeFromSchemaSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); final byte[] bytes = serializationSchema.serialize(testData.f2); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #5
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificDeserializeFromClassSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); final byte[] bytes = serializationSchema.serialize(testData.f2); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #6
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testGenericSerializeSeveralTimes() throws IOException { final Tuple3<GenericRecord, Row, Schema> testData = AvroTestUtils.getGenericTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f2.toString()); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f2.toString()); serializationSchema.serialize(testData.f1); serializationSchema.serialize(testData.f1); final byte[] bytes = serializationSchema.serialize(testData.f1); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f1, actual); }
Example #7
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeFromSchemaSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); serializationSchema.serialize(testData.f2); serializationSchema.serialize(testData.f2); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #8
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeFromClassSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); serializationSchema.serialize(testData.f2); serializationSchema.serialize(testData.f2); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #9
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testGenericSerializeDeserialize() throws IOException { final Tuple3<GenericRecord, Row, Schema> testData = AvroTestUtils.getGenericTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f2.toString()); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f2.toString()); final byte[] bytes = serializationSchema.serialize(testData.f1); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f1, actual); }
Example #10
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeDeserializeFromSchema() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #11
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeDeserializeFromClass() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #12
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSerializability() throws Exception { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); // from class final AvroRowSerializationSchema classSer = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema classDeser = new AvroRowDeserializationSchema(testData.f0); testSerializability(classSer, classDeser, testData.f2); // from schema string final AvroRowSerializationSchema schemaSer = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema schemaDeser = new AvroRowDeserializationSchema(schemaString); testSerializability(schemaSer, schemaDeser, testData.f2); }
Example #13
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testGenericDeserializeSeveralTimes() throws IOException { final Tuple3<GenericRecord, Row, Schema> testData = AvroTestUtils.getGenericTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f2.toString()); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f2.toString()); final byte[] bytes = serializationSchema.serialize(testData.f1); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f1, actual); }
Example #14
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificDeserializeFromSchemaSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); final byte[] bytes = serializationSchema.serialize(testData.f2); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #15
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificDeserializeFromClassSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); final byte[] bytes = serializationSchema.serialize(testData.f2); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #16
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeDeserializeFromClass() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #17
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeFromSchemaSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); serializationSchema.serialize(testData.f2); serializationSchema.serialize(testData.f2); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #18
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeFromClassSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); serializationSchema.serialize(testData.f2); serializationSchema.serialize(testData.f2); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #19
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testGenericSerializeDeserialize() throws IOException { final Tuple3<GenericRecord, Row, Schema> testData = AvroTestUtils.getGenericTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f2.toString()); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f2.toString()); final byte[] bytes = serializationSchema.serialize(testData.f1); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f1, actual); }
Example #20
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeDeserializeFromSchema() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #21
Source File: AvroRowDeSerializationSchemaTest.java From flink with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeDeserializeFromClass() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #22
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testSerializability() throws Exception { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); // from class final AvroRowSerializationSchema classSer = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema classDeser = new AvroRowDeserializationSchema(testData.f0); testSerializability(classSer, classDeser, testData.f2); // from schema string final AvroRowSerializationSchema schemaSer = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema schemaDeser = new AvroRowDeserializationSchema(schemaString); testSerializability(schemaSer, schemaDeser, testData.f2); }
Example #23
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testGenericDeserializeSeveralTimes() throws IOException { final Tuple3<GenericRecord, Row, Schema> testData = AvroTestUtils.getGenericTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f2.toString()); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f2.toString()); final byte[] bytes = serializationSchema.serialize(testData.f1); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f1, actual); }
Example #24
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testSpecificDeserializeFromSchemaSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); final byte[] bytes = serializationSchema.serialize(testData.f2); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #25
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testSpecificDeserializeFromClassSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); final byte[] bytes = serializationSchema.serialize(testData.f2); deserializationSchema.deserialize(bytes); deserializationSchema.deserialize(bytes); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #26
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testGenericSerializeSeveralTimes() throws IOException { final Tuple3<GenericRecord, Row, Schema> testData = AvroTestUtils.getGenericTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f2.toString()); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f2.toString()); serializationSchema.serialize(testData.f1); serializationSchema.serialize(testData.f1); final byte[] bytes = serializationSchema.serialize(testData.f1); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f1, actual); }
Example #27
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeFromSchemaSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); serializationSchema.serialize(testData.f2); serializationSchema.serialize(testData.f2); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #28
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeFromClassSeveralTimes() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f0); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f0); serializationSchema.serialize(testData.f2); serializationSchema.serialize(testData.f2); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }
Example #29
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testGenericSerializeDeserialize() throws IOException { final Tuple3<GenericRecord, Row, Schema> testData = AvroTestUtils.getGenericTestData(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(testData.f2.toString()); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(testData.f2.toString()); final byte[] bytes = serializationSchema.serialize(testData.f1); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f1, actual); }
Example #30
Source File: AvroRowDeSerializationSchemaTest.java From Flink-CEPplus with Apache License 2.0 | 5 votes |
@Test public void testSpecificSerializeDeserializeFromSchema() throws IOException { final Tuple3<Class<? extends SpecificRecord>, SpecificRecord, Row> testData = AvroTestUtils.getSpecificTestData(); final String schemaString = testData.f1.getSchema().toString(); final AvroRowSerializationSchema serializationSchema = new AvroRowSerializationSchema(schemaString); final AvroRowDeserializationSchema deserializationSchema = new AvroRowDeserializationSchema(schemaString); final byte[] bytes = serializationSchema.serialize(testData.f2); final Row actual = deserializationSchema.deserialize(bytes); assertEquals(testData.f2, actual); }