Search in sources :

Example 6 with BsonSymbol

use of org.bson.BsonSymbol in project drill by apache.

the class TestBsonRecordReader method testSymbolType.

@Test
public void testSymbolType() throws IOException {
    BsonDocument bsonDoc = new BsonDocument();
    bsonDoc.append("symbolKey", new BsonSymbol("test_symbol"));
    writer.reset();
    bsonReader.write(writer, new BsonDocumentReader(bsonDoc));
    SingleMapReaderImpl mapReader = (SingleMapReaderImpl) writer.getMapVector().getReader();
    assertEquals("test_symbol", mapReader.reader("symbolKey").readText().toString());
}
Also used : BsonSymbol(org.bson.BsonSymbol) BsonDocument(org.bson.BsonDocument) SingleMapReaderImpl(org.apache.drill.exec.vector.complex.impl.SingleMapReaderImpl) BsonDocumentReader(org.bson.BsonDocumentReader) BaseTest(org.apache.drill.test.BaseTest) Test(org.junit.Test)

Aggregations

BsonSymbol (org.bson.BsonSymbol)6 BsonDocument (org.bson.BsonDocument)4 Test (org.junit.Test)3 Date (java.util.Date)2 SingleMapReaderImpl (org.apache.drill.exec.vector.complex.impl.SingleMapReaderImpl)2 BsonArray (org.bson.BsonArray)2 BsonBinary (org.bson.BsonBinary)2 BsonBoolean (org.bson.BsonBoolean)2 BsonDateTime (org.bson.BsonDateTime)2 BsonDbPointer (org.bson.BsonDbPointer)2 BsonDocumentReader (org.bson.BsonDocumentReader)2 BsonDouble (org.bson.BsonDouble)2 BsonInt32 (org.bson.BsonInt32)2 BsonInt64 (org.bson.BsonInt64)2 BsonJavaScript (org.bson.BsonJavaScript)2 BsonJavaScriptWithScope (org.bson.BsonJavaScriptWithScope)2 BsonNull (org.bson.BsonNull)2 BsonObjectId (org.bson.BsonObjectId)2 BsonRegularExpression (org.bson.BsonRegularExpression)2 BsonString (org.bson.BsonString)2