Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRILL-7979: Self-Closing XML Tags Cause Schema Change Exceptions #2283

Merged
merged 8 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Initial commit
  • Loading branch information
cgivre committed Jul 29, 2021
commit 851cdadf30b26f6892dd79cc3c3d323f2a0f2715
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ private TupleWriter getMapWriter(String mapName, TupleWriter rowWriter) {
// Add map to map collection for future use
nestedMapCollection.put(tempFieldName, new XMLMap(mapName, rowWriter.tuple(index)));
}
logger.debug("Index: {}, Fieldname: {}", index, mapName);
return rowWriter.tuple(index);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,4 +543,12 @@ public void testLimitPushdown() throws Exception {
.include("Limit", "maxRecords=2")
.match();
}

@Test
public void testMapError() throws Exception {
String sql = "SELECT * FROM cp.`xml/servicenow.xml`";
RowSet results = client.queryBuilder().sql(sql).rowSet();
results.print();
}

}
69 changes: 69 additions & 0 deletions contrib/format-xml/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--

Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-->
<configuration>
<if condition='property("drill.lilith.enable").equalsIgnoreCase("true")'>
<then>
<appender name="SOCKET" class="de.huxhorn.lilith.logback.appender.ClassicMultiplexSocketAppender">
<Compressing>true</Compressing>
<ReconnectionDelay>10000</ReconnectionDelay>
<IncludeCallerData>true</IncludeCallerData>
<RemoteHosts>${LILITH_HOSTNAME:-localhost}</RemoteHosts>
</appender>

<logger name="org.apache.drill" additivity="false">
<level value="DEBUG"/>
<appender-ref ref="SOCKET"/>
</logger>

<logger name="query.logger" additivity="false">
<level value="ERROR"/>
<appender-ref ref="SOCKET"/>
</logger>
<logger name="org.apache.drill.exec.store.http">
<level value="DEBUG"/>
<appender-ref ref="SOCKET"/>
</logger>
</then>
</if>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<!--<root>
<level value="WARN"/>
<if condition='property("drill.lilith.enable").equalsIgnoreCase("true")'>
<then>
<appender-ref ref="SOCKET"/>
</then>
</if>
<appender-ref ref="STDOUT"/>
</root>-->
<logger name="org.apache.drill.exec.store.xml" additivity="false">
<level value="debug" />
<appender-ref ref="STDOUT" />
</logger>

</configuration>
Loading