[teiid-commits] teiid SVN: r3920 - in branches/7.7.x/connectors/translator-jdbc/src: test/java/org/teiid/translator/jdbc/ingres and 1 other directory.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Wed Mar 7 16:33:02 EST 2012


Author: shawkins
Date: 2012-03-07 16:33:00 -0500 (Wed, 07 Mar 2012)
New Revision: 3920

Removed:
   branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/LocateFunctionModifier.java
Modified:
   branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/IngresExecutionFactory.java
   branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresExecutionFactory.java
Log:
TEIID-1962 removing locate push down support for ingres

Modified: branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/IngresExecutionFactory.java
===================================================================
--- branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/IngresExecutionFactory.java	2012-03-07 02:09:38 UTC (rev 3919)
+++ branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/IngresExecutionFactory.java	2012-03-07 21:33:00 UTC (rev 3920)
@@ -77,7 +77,6 @@
         registerFunctionModifier(SourceSystemFunctions.RAND, new AliasModifier("random")); //$NON-NLS-1$
         registerFunctionModifier(SourceSystemFunctions.UCASE, new AliasModifier("uppercase")); //$NON-NLS-1$
         registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new AliasModifier("day")); //$NON-NLS-1$
-        registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateFunctionModifier()); 	
         
         addPushDownFunction(INGRES, "bit_add", INTEGER, INTEGER, INTEGER); //$NON-NLS-1$
         addPushDownFunction(INGRES, "bit_length", INTEGER, INTEGER); //$NON-NLS-1$
@@ -140,7 +139,6 @@
 		supportedFunctions.add(SourceSystemFunctions.LCASE);
 		supportedFunctions.add(SourceSystemFunctions.LEFT);
 		supportedFunctions.add(SourceSystemFunctions.LPAD);
-		supportedFunctions.add(SourceSystemFunctions.LOCATE);
 		supportedFunctions.add(SourceSystemFunctions.LENGTH);		
 		supportedFunctions.add(SourceSystemFunctions.LOG);		
 		supportedFunctions.add(SourceSystemFunctions.MINUTE);

Deleted: branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/LocateFunctionModifier.java
===================================================================
--- branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/LocateFunctionModifier.java	2012-03-07 02:09:38 UTC (rev 3919)
+++ branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/LocateFunctionModifier.java	2012-03-07 21:33:00 UTC (rev 3920)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.  Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-package org.teiid.translator.jdbc.ingres;
-
-import java.util.List;
-
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.translator.jdbc.FunctionModifier;
-
-public class LocateFunctionModifier extends FunctionModifier {
-
-    public LocateFunctionModifier() {
-    }	
-    
-	@Override
-	public List<?> translate(Function function) {
-        Expression a = function.getParameters().get(0);
-        Expression b = function.getParameters().get(1);
-        function.getParameters().set(0, b);
-        function.getParameters().set(1, a);
-        return null;
-	}
-
-}

Modified: branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresExecutionFactory.java
===================================================================
--- branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresExecutionFactory.java	2012-03-07 02:09:38 UTC (rev 3919)
+++ branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresExecutionFactory.java	2012-03-07 21:33:00 UTC (rev 3920)
@@ -23,6 +23,7 @@
 package org.teiid.translator.jdbc.ingres;
 
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.teiid.translator.TranslatorException;
 import org.teiid.translator.jdbc.TranslationHelper;
@@ -37,11 +38,19 @@
         TRANSLATOR.start();
     }
 	
+    @Ignore
 	@Test public void testLocate() throws Exception {
 		String input = "SELECT INTKEY FROM BQT1.SmallA WHERE LOCATE(1, INTKEY) = 1 ORDER BY INTKEY"; //$NON-NLS-1$       
         String output = "SELECT SmallA.IntKey FROM SmallA WHERE locate(cast(SmallA.IntKey AS varchar(4000)), '1') = 1 ORDER BY SmallA.IntKey";  //$NON-NLS-1$
         
         TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
 	}
+    
+    @Test public void testLimit() throws Exception {
+		String input = "SELECT INTKEY FROM BQT1.SmallA LIMIT 1"; //$NON-NLS-1$       
+        String output = "SELECT SmallA.IntKey FROM SmallA FETCH FIRST 1 ROWS ONLY";  //$NON-NLS-1$
+        
+        TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
+	}
 	
 }



More information about the teiid-commits mailing list