Package org.apache.phoenix.schema

Examples of org.apache.phoenix.schema.PhoenixArray$PrimitiveBytePhoenixArray


      doubleArr[1] = 36.763;
        doubleArr[2] = 37.56;
            doubleArr[3] = 386.63;
      Array array = conn.createArrayOf("DOUBLE",
          doubleArr);
      PhoenixArray resultArray = (PhoenixArray) rs.getArray(1);
      assertEquals(resultArray, array);
      assertEquals(rs.getString("B_string"), B_VALUE);
      assertTrue(Floats.compare(rs.getFloat(3), 0.01f) == 0);
      assertFalse(rs.next());
    } finally {
View Full Code Here


      strArr[0] = "ABC";
      strArr[1] = "CEDF";
      strArr[2] = "XYZWER";
      strArr[3] = "AB";
      Array array = conn.createArrayOf("VARCHAR", strArr);
      PhoenixArray resultArray = (PhoenixArray) rs.getArray(1);
      assertEquals(resultArray, array);
      assertFalse(rs.next());
    } finally {
      conn.close();
    }
View Full Code Here

        props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 40));
        conn = DriverManager.getConnection(getUrl(), props);
        rs = conn.createStatement().executeQuery("SELECT b_string_array FROM t");
        assertTrue(rs.next());
        PhoenixArray strArr = (PhoenixArray)rs.getArray(1);
        assertEquals(array, strArr);
        conn.close();
    }
View Full Code Here

        conn = DriverManager.getConnection(getUrl(), props);
        rs = conn.createStatement().executeQuery("SELECT CAST(a AS DOUBLE []) FROM t");
        assertTrue(rs.next());
        Double[] d = new Double[] { 1.0, 2.0 };
        array = conn.createArrayOf("DOUBLE", d);
        PhoenixArray arr = (PhoenixArray)rs.getArray(1);
        assertEquals(array, arr);
        conn.close();
    }
View Full Code Here

        props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 30));
        conn = DriverManager.getConnection(getUrl(), props);
        stmt = conn.prepareStatement("UPSERT INTO t VALUES(?,?)");
        stmt.setString(1, "a");
        String[] s = new String[] { "1", "2" };
        PhoenixArray array = (PhoenixArray)conn.createArrayOf("VARCHAR", s);
        stmt.setArray(2, array);
        stmt.execute();
        conn.commit();
        conn.close();

        props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 40));
        conn = DriverManager.getConnection(getUrl(), props);
        rs = conn.createStatement().executeQuery("SELECT CAST(a AS CHAR ARRAY) FROM t");
        assertTrue(rs.next());
        PhoenixArray arr = (PhoenixArray)rs.getArray(1);
        String[] array2 = (String[])array.getArray();
        String[] array3 = (String[])arr.getArray();
        assertEquals(array2[0], array3[0]);
        assertEquals(array2[1], array3[1]);
        conn.close();
    }
View Full Code Here

            doubleArr[0] = 25.343;
            doubleArr[1] = 36.763;
            doubleArr[2] = 37.56;
            doubleArr[3] = 386.63;
      Array array = conn.createArrayOf("DOUBLE", doubleArr);
      PhoenixArray resultArray = (PhoenixArray) rs.getArray(1);
      assertEquals(resultArray, array);
      assertFalse(rs.next());
    } finally {
      conn.close();
    }
View Full Code Here

      ResultSet rs = statement.executeQuery();
      assertTrue(rs.next());
      Double[] doubleArr = new Double[1];
      doubleArr[0] = 36.763;
      Array array = conn.createArrayOf("DOUBLE", doubleArr);
      PhoenixArray resultArray = (PhoenixArray) rs.getArray(1);
      assertEquals(resultArray, array);
      Assert.fail("Should have failed");
    } catch (Exception e) {
    } finally {
      conn.close();
View Full Code Here

      doubleArr[1] = 36.763;
        doubleArr[2] = 37.56;
            doubleArr[3] = 386.63;
      Array array = conn.createArrayOf("DOUBLE",
          doubleArr);
      PhoenixArray resultArray = (PhoenixArray) rs.getArray(1);
      assertEquals(resultArray, array);
      assertEquals(rs.getString("B_string"), B_VALUE);
      assertTrue(Floats.compare(rs.getFloat(3), 0.01f) == 0);
      assertFalse(rs.next());
    } finally {
View Full Code Here

      strArr[0] = "ABC";
      strArr[1] = "CEDF";
      strArr[2] = "XYZWER";
      strArr[3] = "AB";
      Array array = conn.createArrayOf("VARCHAR", strArr);
      PhoenixArray resultArray = (PhoenixArray) rs.getArray(1);
      assertEquals(resultArray, array);
      assertFalse(rs.next());
    } finally {
      conn.close();
    }
View Full Code Here

        props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 40));
        conn = DriverManager.getConnection(getUrl(), props);
        rs = conn.createStatement().executeQuery("SELECT b_string_array FROM t");
        assertTrue(rs.next());
        PhoenixArray strArr = (PhoenixArray)rs.getArray(1);
        assertEquals(array, strArr);
        conn.close();
    }
View Full Code Here

TOP

Related Classes of org.apache.phoenix.schema.PhoenixArray$PrimitiveBytePhoenixArray

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.