Skip to content

Commit

Permalink
TEIID-5055 changing the default for pushdown and updating xmltext
Browse files Browse the repository at this point in the history
  • Loading branch information
shawkins committed Sep 7, 2017
1 parent 7c32178 commit 6aa87e4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Expand Up @@ -1551,7 +1551,7 @@ public static Object session_id(CommandContext context) {
return context.getConnectionId();
}

@TeiidFunction(category=FunctionCategoryConstants.MISCELLANEOUS)
@TeiidFunction(category=FunctionCategoryConstants.MISCELLANEOUS, pushdown=PushDown.CANNOT_PUSHDOWN)
public static String node_id() {
return System.getProperty("jboss.node.name"); //$NON-NLS-1$
}
Expand Down Expand Up @@ -1688,7 +1688,7 @@ public static int array_length(Object array) throws FunctionExecutionException,
throw new FunctionExecutionException(QueryPlugin.Event.TEIID30416, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30416, array.getClass()));
}

@TeiidFunction(category=FunctionCategoryConstants.SYSTEM, determinism = Determinism.COMMAND_DETERMINISTIC)
@TeiidFunction(category=FunctionCategoryConstants.SYSTEM, determinism = Determinism.COMMAND_DETERMINISTIC, pushdown=PushDown.CANNOT_PUSHDOWN)
public static int mvstatus(CommandContext context, String schemaName, String viewName) throws FunctionExecutionException, SQLException, QueryMetadataException, TeiidComponentException {
Object id = context.getMetadata().getGroupID(schemaName + AbstractMetadataRecord.NAME_DELIM_CHAR + viewName);
String statusTable = context.getMetadata().getExtensionProperty(id, MaterializationMetadataRepository.MATVIEW_STATUS_TABLE, false);
Expand Down
Expand Up @@ -23,6 +23,7 @@
import org.teiid.adminapi.impl.SessionMetadata;
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.metadata.FunctionMethod.Determinism;
import org.teiid.metadata.FunctionMethod.PushDown;
import org.teiid.query.QueryPlugin;
import org.teiid.query.function.metadata.FunctionCategoryConstants;
import org.teiid.query.util.CommandContext;
Expand All @@ -31,12 +32,12 @@ public class SystemFunctionMethods {

private static final int MAX_VARIABLES = 512;

@TeiidFunction(category=FunctionCategoryConstants.SYSTEM, nullOnNull=true, determinism=Determinism.COMMAND_DETERMINISTIC)
@TeiidFunction(category=FunctionCategoryConstants.SYSTEM, nullOnNull=true, determinism=Determinism.COMMAND_DETERMINISTIC, pushdown=PushDown.CANNOT_PUSHDOWN)
public static Object teiid_session_get(CommandContext context, String key) {
return context.getSessionVariable(key);
}

@TeiidFunction(category=FunctionCategoryConstants.SYSTEM, determinism=Determinism.COMMAND_DETERMINISTIC)
@TeiidFunction(category=FunctionCategoryConstants.SYSTEM, determinism=Determinism.COMMAND_DETERMINISTIC, pushdown=PushDown.CANNOT_PUSHDOWN)
public static Object teiid_session_set(CommandContext context, String key, Object value) throws FunctionExecutionException {
SessionMetadata session = context.getSession();
Map<String, Object> variables = session.getSessionVariables();
Expand Down
Expand Up @@ -37,6 +37,6 @@
String category();
boolean nullOnNull() default false;
Determinism determinism() default Determinism.DETERMINISTIC;
PushDown pushdown() default PushDown.CANNOT_PUSHDOWN;
PushDown pushdown() default PushDown.CAN_PUSHDOWN;
String alias() default "";
}
Expand Up @@ -1254,7 +1254,7 @@ public static XMLOutputFactory getOutputFactory(boolean repairing) {
return f;
}

@TeiidFunction(category=FunctionCategoryConstants.XML)
@TeiidFunction(category=FunctionCategoryConstants.XML, nullOnNull=true)
public static XMLType xmlText(String val) throws XMLStreamException, FactoryConfigurationError, IOException, TransformerException {
//TODO: see if there is a less involved way to escape
StringWriter writer = new StringWriter();
Expand Down

0 comments on commit 6aa87e4

Please sign in to comment.