Closed ckunki closed 2 years ago
Sample implementation
private Map<String, String> debugProperties() {
final String debugAddress = System.getProperty("com.exasol.virtualschema.debug.address");
if (debugAddress == null) {
return Collections.emptyMap();
}
final String logLevel = System.getProperty("com.exasol.virtualschema.debug.level");
return Map.of("DEBUG_ADDRESS", debugAddress, "LOG_LEVEL", (logLevel != null ? logLevel : "ALL"));
}
Class IntegrationTestSetup
in https://github.com/exasol/s3-document-files-virtual-schema uses
System.getProperty("test.vs-logs")
but expects only a boolean value and uses localhost
Use uniform property names:
private Map<String, String> debugProperties() {
final String debugHost = System.getProperty("com.exasol.log.host", null);
if (debugHost == null) {
return Collections.emptyMap();
}
final String debugPort = System.getProperty("com.exasol.log.port", "3000");
final String logLevel = System.getProperty("com.exasol.log.level", "ALL");
final String address = debugHost + ":" + debugPort;
return Map.of("DEBUG_ADDRESS", address, "LOG_LEVEL", logLevel);
}
See also https://github.com/exasol/google-cloud-storage-document-files-virtual-schema/pull/25
CREATE VIRTUAL SCHEMA
allows to setDEBUG_ADDRESS
andLOG_LEVEL
in order to debug virtual schemas regarding pushdown statements etc., see logging in documentation.Currently developers add properties in the source code of the virtual schema they are currently working on, e.g.
MySQLVirtualSchemaIntegrationTestSetup.createVirtualSchema()
:This creates the risk to forget to revert the code changes before merging to git main branch.
The current ticket therefore proposes to support properties or environment variables in order to set
DEBUG_ADDRESS
andLOG_LEVEL
. These properties or environment variables are then outside the code, effect only the local machine of the developer and will not be merged.Adding this functionality to test-db-builder-java creates immediate benefit for all virtual schemas.