luocooong commented on a change in pull request #2132:
URL: https://github.com/apache/drill/pull/2132#discussion_r551814647
##########
File path:
contrib/format-xml/src/test/java/org/apache/drill/exec/store/xml/TestXMLReader.java
##########
@@ -83,6 +83,37 @@ public void testWildcard() throws Exception {
new RowSetComparison(expected).verifyAndClearAll(results);
}
+ @Test
+ public void testSelfClosingTags() throws Exception {
+ String sql = "SELECT * FROM cp.`xml/weather.xml`";
+ RowSet results = client.queryBuilder().sql(sql).rowSet();
+ assertEquals(1, results.rowCount());
+
+ TupleMetadata expectedSchema = new SchemaBuilder()
+ .addMap("attributes")
+ .addNullable("forecast_information_city_data", MinorType.VARCHAR)
+ .addNullable("forecast_information_postal_code_data",
MinorType.VARCHAR)
+ .addNullable("forecast_information_latitude_e6_data",
MinorType.VARCHAR)
+ .addNullable("forecast_information_longitude_e6_data",
MinorType.VARCHAR)
+ .addNullable("forecast_information_forecast_date_data",
MinorType.VARCHAR)
+ .addNullable("forecast_information_current_date_time_data",
MinorType.VARCHAR)
+ .addNullable("forecast_information_unit_system_data",
MinorType.VARCHAR)
+
.addNullable("forecast_information_current_conditions_condition_data",
MinorType.VARCHAR)
+ .addNullable("forecast_information_current_conditions_temp_f_data",
MinorType.VARCHAR)
+ .addNullable("forecast_information_current_conditions_temp_c_data",
MinorType.VARCHAR)
+
.addNullable("forecast_information_current_conditions_humidity_data",
MinorType.VARCHAR)
+ .addNullable("forecast_information_current_conditions_icon_data",
MinorType.VARCHAR)
+
.addNullable("forecast_information_current_conditions_wind_condition_data",
MinorType.VARCHAR)
Review comment:
This is the power of Drill. Any data reading can be like unpacking a
complex parcel.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]