@Override public String getPath() { return session.getPath().toString(); }
session.getCatalog().orElse(null), session.getSchema().orElse(null), session.getPath().toString(), session.getTimeZoneKey().getId(), session.getLocale(),
@ScalarFunction(value = "$current_path", hidden = true) @Description("retrieve current path") @SqlType(StandardTypes.VARCHAR) public static Slice currentPath(ConnectorSession session) { // this function is a language construct and has special access to internals return utf8Slice(((FullConnectorSession) session).getSession().getPath().toString()); } }
assertEquals(session.getCatalog().get(), "testCatalog"); assertEquals(session.getSchema().get(), "testSchema"); assertEquals(session.getPath().getRawPath().get(), "testPath"); assertEquals(session.getLocale(), Locale.TAIWAN); assertEquals(session.getTimeZoneKey(), getTimeZoneKey("Asia/Taipei"));
.setCatalog(catalog.orElse(null)) .setSchema(schema.orElse(null)) .setPath(session.getPath()) .setTimeZoneKey(session.getTimeZoneKey()) .setLocale(session.getLocale())
getSession().getCatalog(), getSession().getSchema(), getSession().getPath(), getSession().getTraceToken(), getSession().getTimeZoneKey(),
@Test public void testCurrentPath() { Session session = testSessionBuilder() .setPath(new SqlPath(Optional.of("testPath"))) .build(); try (QueryAssertions queryAssertions = new QueryAssertions(session)) { queryAssertions.assertQuery("SELECT CURRENT_PATH", "SELECT CAST('" + session.getPath().toString() + "' AS VARCHAR)"); } Session emptyPathSession = testSessionBuilder() .setPath(new SqlPath(Optional.of("\"\""))) .build(); try (QueryAssertions queryAssertions = new QueryAssertions(emptyPathSession)) { queryAssertions.assertQuery("SELECT CURRENT_PATH", "SELECT CAST('" + emptyPathSession.getPath().toString() + "' AS VARCHAR)"); } } }
defaultSession.getCatalog(), defaultSession.getSchema(), defaultSession.getPath(), defaultSession.getTraceToken(), defaultSession.getTimeZoneKey(),
@Override public String getPath() { return session.getPath().toString(); }
session.getCatalog().orElse(null), session.getSchema().orElse(null), session.getPath().toString(), session.getTimeZoneKey().getId(), session.getLocale(),
getSession().getCatalog(), getSession().getSchema(), getSession().getPath(), getSession().getTraceToken(), getSession().getTimeZoneKey(),