@@ -1495,120 +1495,120 @@ TEST(TestLogicalTypeOperation, LogicalTypeRepresentation) {
14951495 };
14961496
14971497 std::vector<ExpectedRepresentation> cases = {
1498- {UndefinedLogicalType::Make (), " Undefined" , R"( {"Type": "Undefined"})" },
1499- {LogicalType::String (), " String" , R"( {"Type": "String"})" },
1500- {LogicalType::Map (), " Map" , R"( {"Type": "Map"})" },
1501- {LogicalType::List (), " List" , R"( {"Type": "List"})" },
1502- {LogicalType::Enum (), " Enum" , R"( {"Type": "Enum"})" },
1498+ {UndefinedLogicalType::Make (), " Undefined" , R"( {"Type":"Undefined"})" },
1499+ {LogicalType::String (), " String" , R"( {"Type":"String"})" },
1500+ {LogicalType::Map (), " Map" , R"( {"Type":"Map"})" },
1501+ {LogicalType::List (), " List" , R"( {"Type":"List"})" },
1502+ {LogicalType::Enum (), " Enum" , R"( {"Type":"Enum"})" },
15031503 {LogicalType::Decimal (10 , 4 ), " Decimal(precision=10, scale=4)" ,
1504- R"( {"Type": "Decimal", "precision": 10, "scale": 4})" },
1504+ R"( {"Type":"Decimal","precision":10,"scale":4})" },
15051505 {LogicalType::Decimal (10 ), " Decimal(precision=10, scale=0)" ,
1506- R"( {"Type": "Decimal", "precision": 10, "scale": 0})" },
1507- {LogicalType::Date (), " Date" , R"( {"Type": "Date"})" },
1506+ R"( {"Type":"Decimal","precision":10,"scale":0})" },
1507+ {LogicalType::Date (), " Date" , R"( {"Type":"Date"})" },
15081508 {LogicalType::Time (true , LogicalType::TimeUnit::MILLIS ),
15091509 " Time(isAdjustedToUTC=true, timeUnit=milliseconds)" ,
1510- R"( {"Type": "Time", "isAdjustedToUTC": true, "timeUnit": "milliseconds"})" },
1510+ R"( {"Type":"Time","isAdjustedToUTC":true,"timeUnit":"milliseconds"})" },
15111511 {LogicalType::Time (true , LogicalType::TimeUnit::MICROS ),
15121512 " Time(isAdjustedToUTC=true, timeUnit=microseconds)" ,
1513- R"( {"Type": "Time", "isAdjustedToUTC": true, "timeUnit": "microseconds"})" },
1513+ R"( {"Type":"Time","isAdjustedToUTC":true,"timeUnit":"microseconds"})" },
15141514 {LogicalType::Time (true , LogicalType::TimeUnit::NANOS ),
15151515 " Time(isAdjustedToUTC=true, timeUnit=nanoseconds)" ,
1516- R"( {"Type": "Time", "isAdjustedToUTC": true, "timeUnit": "nanoseconds"})" },
1516+ R"( {"Type":"Time","isAdjustedToUTC":true,"timeUnit":"nanoseconds"})" },
15171517 {LogicalType::Time (false , LogicalType::TimeUnit::MILLIS ),
15181518 " Time(isAdjustedToUTC=false, timeUnit=milliseconds)" ,
1519- R"( {"Type": "Time", "isAdjustedToUTC": false, "timeUnit": "milliseconds"})" },
1519+ R"( {"Type":"Time","isAdjustedToUTC":false,"timeUnit":"milliseconds"})" },
15201520 {LogicalType::Time (false , LogicalType::TimeUnit::MICROS ),
15211521 " Time(isAdjustedToUTC=false, timeUnit=microseconds)" ,
1522- R"( {"Type": "Time", "isAdjustedToUTC": false, "timeUnit": "microseconds"})" },
1522+ R"( {"Type":"Time","isAdjustedToUTC":false,"timeUnit":"microseconds"})" },
15231523 {LogicalType::Time (false , LogicalType::TimeUnit::NANOS ),
15241524 " Time(isAdjustedToUTC=false, timeUnit=nanoseconds)" ,
1525- R"( {"Type": "Time", "isAdjustedToUTC": false, "timeUnit": "nanoseconds"})" },
1525+ R"( {"Type":"Time","isAdjustedToUTC":false,"timeUnit":"nanoseconds"})" },
15261526 {LogicalType::Timestamp (true , LogicalType::TimeUnit::MILLIS ),
15271527 " Timestamp(isAdjustedToUTC=true, timeUnit=milliseconds, "
15281528 " is_from_converted_type=false, force_set_converted_type=false)" ,
1529- R"( {"Type": "Timestamp", "isAdjustedToUTC": true, "timeUnit": "milliseconds", )"
1530- R"( "is_from_converted_type": false, "force_set_converted_type": false})" },
1529+ R"( {"Type":"Timestamp","isAdjustedToUTC":true,"timeUnit":"milliseconds",)"
1530+ R"( "is_from_converted_type":false,"force_set_converted_type":false})" },
15311531 {LogicalType::Timestamp (true , LogicalType::TimeUnit::MICROS ),
15321532 " Timestamp(isAdjustedToUTC=true, timeUnit=microseconds, "
15331533 " is_from_converted_type=false, force_set_converted_type=false)" ,
1534- R"( {"Type": "Timestamp", "isAdjustedToUTC": true, "timeUnit": "microseconds", )"
1535- R"( "is_from_converted_type": false, "force_set_converted_type": false})" },
1534+ R"( {"Type":"Timestamp","isAdjustedToUTC":true,"timeUnit":"microseconds",)"
1535+ R"( "is_from_converted_type":false,"force_set_converted_type":false})" },
15361536 {LogicalType::Timestamp (true , LogicalType::TimeUnit::NANOS ),
15371537 " Timestamp(isAdjustedToUTC=true, timeUnit=nanoseconds, "
15381538 " is_from_converted_type=false, force_set_converted_type=false)" ,
1539- R"( {"Type": "Timestamp", "isAdjustedToUTC": true, "timeUnit": "nanoseconds", )"
1540- R"( "is_from_converted_type": false, "force_set_converted_type": false})" },
1539+ R"( {"Type":"Timestamp","isAdjustedToUTC":true,"timeUnit":"nanoseconds",)"
1540+ R"( "is_from_converted_type":false,"force_set_converted_type":false})" },
15411541 {LogicalType::Timestamp (false , LogicalType::TimeUnit::MILLIS , true , true ),
15421542 " Timestamp(isAdjustedToUTC=false, timeUnit=milliseconds, "
15431543 " is_from_converted_type=true, force_set_converted_type=true)" ,
1544- R"( {"Type": "Timestamp", "isAdjustedToUTC": false, "timeUnit": "milliseconds", )"
1545- R"( "is_from_converted_type": true, "force_set_converted_type": true})" },
1544+ R"( {"Type":"Timestamp","isAdjustedToUTC":false,"timeUnit":"milliseconds",)"
1545+ R"( "is_from_converted_type":true,"force_set_converted_type":true})" },
15461546 {LogicalType::Timestamp (false , LogicalType::TimeUnit::MICROS ),
15471547 " Timestamp(isAdjustedToUTC=false, timeUnit=microseconds, "
15481548 " is_from_converted_type=false, force_set_converted_type=false)" ,
1549- R"( {"Type": "Timestamp", "isAdjustedToUTC": false, "timeUnit": "microseconds", )"
1550- R"( "is_from_converted_type": false, "force_set_converted_type": false})" },
1549+ R"( {"Type":"Timestamp","isAdjustedToUTC":false,"timeUnit":"microseconds",)"
1550+ R"( "is_from_converted_type":false,"force_set_converted_type":false})" },
15511551 {LogicalType::Timestamp (false , LogicalType::TimeUnit::NANOS ),
15521552 " Timestamp(isAdjustedToUTC=false, timeUnit=nanoseconds, "
15531553 " is_from_converted_type=false, force_set_converted_type=false)" ,
1554- R"( {"Type": "Timestamp", "isAdjustedToUTC": false, "timeUnit": "nanoseconds", )"
1555- R"( "is_from_converted_type": false, "force_set_converted_type": false})" },
1556- {LogicalType::Interval (), " Interval" , R"( {"Type": "Interval"})" },
1554+ R"( {"Type":"Timestamp","isAdjustedToUTC":false,"timeUnit":"nanoseconds",)"
1555+ R"( "is_from_converted_type":false,"force_set_converted_type":false})" },
1556+ {LogicalType::Interval (), " Interval" , R"( {"Type":"Interval"})" },
15571557 {LogicalType::Int (8 , false ), " Int(bitWidth=8, isSigned=false)" ,
1558- R"( {"Type": "Int", "bitWidth": 8, "isSigned": false})" },
1558+ R"( {"Type":"Int","bitWidth":8, "isSigned":false})" },
15591559 {LogicalType::Int (16 , false ), " Int(bitWidth=16, isSigned=false)" ,
1560- R"( {"Type": "Int", "bitWidth": 16, "isSigned": false})" },
1560+ R"( {"Type":"Int","bitWidth":16,"isSigned":false})" },
15611561 {LogicalType::Int (32 , false ), " Int(bitWidth=32, isSigned=false)" ,
1562- R"( {"Type": "Int", "bitWidth": 32, "isSigned": false})" },
1562+ R"( {"Type":"Int","bitWidth":32,"isSigned":false})" },
15631563 {LogicalType::Int (64 , false ), " Int(bitWidth=64, isSigned=false)" ,
1564- R"( {"Type": "Int", "bitWidth": 64, "isSigned": false})" },
1564+ R"( {"Type":"Int","bitWidth":64,"isSigned":false})" },
15651565 {LogicalType::Int (8 , true ), " Int(bitWidth=8, isSigned=true)" ,
1566- R"( {"Type": "Int", "bitWidth": 8, "isSigned": true})" },
1566+ R"( {"Type":"Int","bitWidth":8, "isSigned":true})" },
15671567 {LogicalType::Int (16 , true ), " Int(bitWidth=16, isSigned=true)" ,
1568- R"( {"Type": "Int", "bitWidth": 16, "isSigned": true})" },
1568+ R"( {"Type":"Int","bitWidth":16,"isSigned":true})" },
15691569 {LogicalType::Int (32 , true ), " Int(bitWidth=32, isSigned=true)" ,
1570- R"( {"Type": "Int", "bitWidth": 32, "isSigned": true})" },
1570+ R"( {"Type":"Int","bitWidth":32,"isSigned":true})" },
15711571 {LogicalType::Int (64 , true ), " Int(bitWidth=64, isSigned=true)" ,
1572- R"( {"Type": "Int", "bitWidth": 64, "isSigned": true})" },
1573- {LogicalType::Null (), " Null" , R"( {"Type": "Null"})" },
1574- {LogicalType::JSON (), " JSON" , R"( {"Type": "JSON"})" },
1575- {LogicalType::BSON (), " BSON" , R"( {"Type": "BSON"})" },
1576- {LogicalType::UUID (), " UUID" , R"( {"Type": "UUID"})" },
1577- {LogicalType::Float16 (), " Float16" , R"( {"Type": "Float16"})" },
1578- {LogicalType::Geometry (), " Geometry(crs=)" , R"( {"Type": "Geometry"})" },
1572+ R"( {"Type":"Int","bitWidth":64,"isSigned":true})" },
1573+ {LogicalType::Null (), " Null" , R"( {"Type":"Null"})" },
1574+ {LogicalType::JSON (), " JSON" , R"( {"Type":"JSON"})" },
1575+ {LogicalType::BSON (), " BSON" , R"( {"Type":"BSON"})" },
1576+ {LogicalType::UUID (), " UUID" , R"( {"Type":"UUID"})" },
1577+ {LogicalType::Float16 (), " Float16" , R"( {"Type":"Float16"})" },
1578+ {LogicalType::Geometry (), " Geometry(crs=)" , R"( {"Type":"Geometry"})" },
15791579 {LogicalType::Geometry (" srid:1234" ), " Geometry(crs=srid:1234)" ,
1580- R"( {"Type": "Geometry", "crs": "srid:1234"})" },
1580+ R"( {"Type":"Geometry","crs":"srid:1234"})" },
15811581 {LogicalType::Geometry (R"( crs with "quotes" and \backslashes\)" ),
15821582 R"( Geometry(crs=crs with "quotes" and \backslashes\))" ,
1583- R"( {"Type": "Geometry", "crs": "crs with \"quotes\" and \\backslashes\\"})" },
1583+ R"( {"Type":"Geometry","crs":"crs with \"quotes\" and \\backslashes\\"})" },
15841584 {LogicalType::Geometry (" crs with control characters \u0001 and \u001f " ),
15851585 " Geometry(crs=crs with control characters \u0001 and \u001f )" ,
1586- R"( {"Type": "Geometry", "crs": "crs with control characters \u0001 and \u001f"})" },
1586+ R"( {"Type":"Geometry","crs":"crs with control characters \u0001 and \u001f"})" },
15871587 {LogicalType::Geography (), " Geography(crs=, algorithm=spherical)" ,
1588- R"( {"Type": "Geography"})" },
1588+ R"( {"Type":"Geography"})" },
15891589 {LogicalType::Geography (" srid:1234" ,
15901590 LogicalType::EdgeInterpolationAlgorithm::SPHERICAL ),
15911591 " Geography(crs=srid:1234, algorithm=spherical)" ,
1592- R"( {"Type": "Geography", "crs": "srid:1234"})" },
1592+ R"( {"Type":"Geography","crs":"srid:1234"})" },
15931593 {LogicalType::Geography (" srid:1234" ,
15941594 LogicalType::EdgeInterpolationAlgorithm::VINCENTY ),
15951595 " Geography(crs=srid:1234, algorithm=vincenty)" ,
1596- R"( {"Type": "Geography", "crs": "srid:1234", "algorithm": "vincenty"})" },
1596+ R"( {"Type":"Geography","crs":"srid:1234","algorithm":"vincenty"})" },
15971597 {LogicalType::Geography (" srid:1234" ,
15981598 LogicalType::EdgeInterpolationAlgorithm::THOMAS ),
15991599 " Geography(crs=srid:1234, algorithm=thomas)" ,
1600- R"( {"Type": "Geography", "crs": "srid:1234", "algorithm": "thomas"})" },
1600+ R"( {"Type":"Geography","crs":"srid:1234","algorithm":"thomas"})" },
16011601 {LogicalType::Geography (" srid:1234" ,
16021602 LogicalType::EdgeInterpolationAlgorithm::ANDOYER ),
16031603 " Geography(crs=srid:1234, algorithm=andoyer)" ,
1604- R"( {"Type": "Geography", "crs": "srid:1234", "algorithm": "andoyer"})" },
1604+ R"( {"Type":"Geography","crs":"srid:1234","algorithm":"andoyer"})" },
16051605 {LogicalType::Geography (" srid:1234" ,
16061606 LogicalType::EdgeInterpolationAlgorithm::KARNEY ),
16071607 " Geography(crs=srid:1234, algorithm=karney)" ,
1608- R"( {"Type": "Geography", "crs": "srid:1234", "algorithm": "karney"})" },
1609- {LogicalType::Variant (), " Variant(1)" , R"( {"Type": "Variant", "SpecVersion": 1})" },
1610- {LogicalType::Variant (2 ), " Variant(2)" , R"( {"Type": "Variant", "SpecVersion": 2})" },
1611- {LogicalType::None (), " None" , R"( {"Type": "None"})" },
1608+ R"( {"Type":"Geography","crs":"srid:1234","algorithm":"karney"})" },
1609+ {LogicalType::Variant (), " Variant(1)" , R"( {"Type":"Variant","SpecVersion":1})" },
1610+ {LogicalType::Variant (2 ), " Variant(2)" , R"( {"Type":"Variant","SpecVersion":2})" },
1611+ {LogicalType::None (), " None" , R"( {"Type":"None"})" },
16121612 };
16131613
16141614 for (const ExpectedRepresentation& c : cases) {
0 commit comments