Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 56D62200BF3 for ; Wed, 21 Dec 2016 16:27:02 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 55C85160B0C; Wed, 21 Dec 2016 15:27:02 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2759A160B39 for ; Wed, 21 Dec 2016 16:27:01 +0100 (CET) Received: (qmail 32474 invoked by uid 500); 21 Dec 2016 15:27:00 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 31828 invoked by uid 99); 21 Dec 2016 15:26:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2016 15:26:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 1F5452C2ACA for ; Wed, 21 Dec 2016 15:26:59 +0000 (UTC) Date: Wed, 21 Dec 2016 15:26:59 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-5084) Replace Java Table API integration tests by unit tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 21 Dec 2016 15:27:02 -0000 [ https://issues.apache.org/jira/browse/FLINK-5084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15767309#comment-15767309 ] ASF GitHub Bot commented on FLINK-5084: --------------------------------------- Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/2977#discussion_r93440355 --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/api/scala/batch/table/CalcValidationTest.scala --- @@ -0,0 +1,111 @@ +/* + * 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. + */ + +package org.apache.flink.api.scala.batch.table + +import org.apache.flink.api.scala._ +import org.apache.flink.api.scala.batch.utils.TableProgramsTestBase +import org.apache.flink.api.scala.batch.utils.TableProgramsTestBase.TableConfigMode +import org.apache.flink.api.scala.table._ +import org.apache.flink.api.scala.util.CollectionDataSets +import org.apache.flink.api.table.{Row, TableEnvironment, ValidationException} +import org.apache.flink.test.util.MultipleProgramsTestBase.TestExecutionMode +import org.junit._ +import org.junit.runner.RunWith +import org.junit.runners.Parameterized + +@RunWith(classOf[Parameterized]) +class CalcValidationTest( + mode: TestExecutionMode, + configMode: TableConfigMode) + extends TableProgramsTestBase(mode, configMode) { --- End diff -- Do not extend `TableProgramsTestBase`. This is only necessary for ITCases. > Replace Java Table API integration tests by unit tests > ------------------------------------------------------ > > Key: FLINK-5084 > URL: https://issues.apache.org/jira/browse/FLINK-5084 > Project: Flink > Issue Type: Task > Components: Table API & SQL > Reporter: Fabian Hueske > Priority: Minor > > The Java Table API is a wrapper on top of the Scala Table API. > Instead of operating directly with Expressions like the Scala API, the Java API accepts a String parameter which is parsed into Expressions. > We could therefore replace the Java Table API ITCases by tests that check that the parsing step produces a valid logical plan. > This could be done by creating two {{Table}} objects for an identical query once with the Scala Expression API and one with the Java String API and comparing the logical plans of both {{Table}} objects. Basically something like the following: > {code} > val ds1 = CollectionDataSets.getSmall3TupleDataSet(env).toTable(tEnv, 'a, 'b, 'c) > val ds2 = CollectionDataSets.get5TupleDataSet(env).toTable(tEnv, 'd, 'e, 'f, 'g, 'h) > val joinT1 = ds1.join(ds2).where('b === 'e).select('c, 'g) > val joinT2 = ds1.join(ds2).where("b = e").select("c, g") > val lPlan1 = joinT1.logicalPlan > val lPlan2 = joinT2.logicalPlan > Assert.assertEquals("Logical Plans do not match", lPlan1, lPlan2) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)