Package net.sf.jsqlparser.expression

Examples of net.sf.jsqlparser.expression.DateValue


        _columnOrderdate.setTable(table);
        _columnOrderdate.setColumnName("ORDERDATE");

        MinorThan mt = new MinorThan();
        mt.setLeftExpression(_columnOrderdate);
        mt.setRightExpression(new DateValue(" 1995-01-01 "));
       
        String path = "../test/squall/schemas/tpch.txt";
        double scallingFactor = 1;
        _selEstimator = new SelingerSelectivityEstimator("TEST", new Schema(path, scallingFactor), new TableAliasName(tableList, "SelingerTest"));
    }
View Full Code Here


    @Test
    public void testEstimate_MinorThan() {
        LOG.info("test estimate(MinorThan):");
        MinorThan mt = new MinorThan();
        mt.setLeftExpression(_columnOrderdate);
        mt.setRightExpression(new DateValue("d" + "1995-01-01" + "d"));
        assertEquals("0.45571725571725574", String.valueOf(_selEstimator.estimate(mt)));
    }
View Full Code Here

    @Test
    public void testVisit_DateValue() {
        LOG.info("visit(DateValue):");
        String dateStr = "1995-01-01";
        Date squallDate = new DateConversion().fromString(dateStr);
        Expression exp = new DateValue(" " + dateStr + " ");
        exp.accept(_visitor);
        Date jsqlDate = (Date) _visitor.getResult();
        assertEquals(jsqlDate, squallDate);
    }
View Full Code Here

        LOG.info("visit(DateOp1):");
        Date END_DATE = _dtc.fromString("1998-12-31");
        Date orderDateEnd = new DateSum(new ValueSpecification(_dtc, END_DATE), Calendar.DATE, -151).eval(null);
       
        String dateExp = "1998-08-02";
        Expression exp = new DateValue(" " + dateExp + " ");
        exp.accept(_visitor);
        Date jsqlDate = (Date) _visitor.getResult();
        assertEquals(jsqlDate, orderDateEnd);
    }
View Full Code Here

        LOG.info("visit(DateOp2):");
        Date END_DATE = _dtc.fromString("1998-12-31");
        Date orderDateEnd = new DateSum(new ValueSpecification(_dtc, END_DATE), Calendar.DATE, -30).eval(null);
       
        String dateExp = "1998-12-01";
        Expression exp = new DateValue(" " + dateExp + " ");
        exp.accept(_visitor);
        Date jsqlDate = (Date) _visitor.getResult();
        assertEquals(jsqlDate, orderDateEnd);
    }   
View Full Code Here

        LOG.info("visit(DateOp3):");
        Date END_DATE = _dtc.fromString("1998-12-31");
        Date orderDateEnd = new DateSum(new ValueSpecification(_dtc, END_DATE), Calendar.DATE, -61).eval(null);
       
        String dateExp = "1998-10-31";
        Expression exp = new DateValue(" " + dateExp + " ");
        exp.accept(_visitor);
        Date jsqlDate = (Date) _visitor.getResult();
        assertEquals(jsqlDate, orderDateEnd);
   
View Full Code Here

        LOG.info("visit(DateOp4):");
        Date END_DATE = _dtc.fromString("1998-12-31");
        Date orderDateEnd = new DateSum(new ValueSpecification(_dtc, END_DATE), Calendar.DATE, -121).eval(null);
       
        String dateExp = "1998-09-01";
        Expression exp = new DateValue(" " + dateExp + " ");
        exp.accept(_visitor);
        Date jsqlDate = (Date) _visitor.getResult();
        assertEquals(jsqlDate, orderDateEnd);
    }   
View Full Code Here

          break;
        case 98:
          jj_consume_token(98);
          token = jj_consume_token(S_CHAR_LITERAL);
          jj_consume_token(99);
                                                  retval = new DateValue(token.image);
          break;
        case 100:
          jj_consume_token(100);
          token = jj_consume_token(S_CHAR_LITERAL);
          jj_consume_token(99);
View Full Code Here

TOP

Related Classes of net.sf.jsqlparser.expression.DateValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.