madlib-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iyerr3 <...@git.apache.org>
Subject [GitHub] madlib pull request #282: Utilites: Add CTAS while dropping some columns
Date Tue, 03 Jul 2018 15:59:23 GMT
Github user iyerr3 commented on a diff in the pull request:

    https://github.com/apache/madlib/pull/282#discussion_r199862080
  
    --- Diff: src/ports/postgres/modules/utilities/test/utilities.sql_in ---
    @@ -0,0 +1,77 @@
    +/* ----------------------------------------------------------------------- */
    +/**
    + *
    + * 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.
    + *
    + */
    +/* ----------------------------------------------------------------------- */
    +
    +CREATE TABLE "__madlib_temp_Quoted"(b varchar);
    +CREATE TABLE __madlib_temp_non_quoted(a text);
    +-- assert that madlib_temp tables are created
    +SELECT assert(count(*) >= 2, 'Error setting up madlib_temp in schema ' || quote_ident(current_schema()))
    +FROM pg_tables
    +WHERE tablename LIKE '%madlib\_temp%'
    +  AND quote_ident(schemaname) = quote_ident(current_schema());
    +
    +-- cleanup
    +SELECT cleanup_madlib_temp_tables(quote_ident(current_schema()));
    +
    +-- assert that madlib_temp tables are dropped
    +SELECT assert(count(*) = 0, 'Error cleaning up madlib_temp in schema ' || quote_ident(current_schema()))
    +FROM pg_tables
    +WHERE tablename LIKE '%madlib\_temp%'
    +  AND quote_ident(schemaname) = quote_ident(current_schema());
    +
    +-- test dropcols
    +DROP TABLE IF EXISTS dt_golf CASCADE;
    +CREATE TABLE dt_golf (
    +    id integer NOT NULL,
    +    id_2 integer,
    +    "OUTLOOK" text,
    +    temperature double precision,
    +    humidity double precision,
    +    "Cont,features" double precision[],
    +    cat_features text[],
    +    windy boolean,
    +    class text
    +) ;
    +
    +INSERT INTO dt_golf (id,"OUTLOOK",temperature,humidity,"Cont,features",cat_features,
windy,class) VALUES
    --- End diff --
    
    I've added another column, but I expect all chars requiring a double quote to behave similarly.



---

Mime
View raw message