Ejemplo n.º 1
0
 def test_vectorwise(self):
     a = Babe().pull(stream=StringIO(self.s), format='csv')
     a = a.typedetect()
     a.push_sql(table='test_table', database_kind='vectorwise', database='pybabe_test', drop_table = True, create_table=True)
     b = Babe().pull_sql(database_kind='vectorwise', database='pybabe_test', table='test_table')
     buf = StringIO()
     b.push(stream=buf, format='csv', delimiter=',')
     self.assertEquals(buf.getvalue(), self.s)
Ejemplo n.º 2
0
 def test_pushsqlite(self):
     a = Babe().pull(string=self.s, format='csv')
     a = a.typedetect()
     a.push_sql(table='test_table',
                database_kind='sqlite',
                database='tests/files/test.sqlite',
                drop_table=True,
                create_table=True)
     b = Babe().pull_sql(database_kind='sqlite',
                         database='tests/files/test.sqlite',
                         table='test_table')
     self.assertEquals(b.to_string(), self.s)
Ejemplo n.º 3
0
 def test_vectorwise(self):
     a = Babe().pull(string=self.s, format='csv')
     a = a.typedetect()
     a.push_sql(table='test_table',
                database_kind='vectorwise',
                database='pybabe_test',
                drop_table=True,
                create_table=True)
     b = Babe().pull_sql(database_kind='vectorwise',
                         database='pybabe_test',
                         table='test_table')
     self.assertEquals(b.to_string(), self.s)
Ejemplo n.º 4
0
    def test_pushsqlite_partition(self):
        a = Babe().pull(string=self.s, format='csv')
        a = a.typedetect()
        a.push_sql(table='test_table', database_kind='sqlite', database='test.sqlite', drop_table = True, create_table=True)

        a = Babe().pull(string=self.s2, format='csv')
        a = a.typedetect()
        a = a.partition(field='id')
        a.push_sql(table='test_table', database_kind='sqlite', database='test.sqlite', delete_partition=True)

        b = Babe().pull_sql(database_kind='sqlite', database='test.sqlite', table='test_table')
        b = b.sort(field="id")
        self.assertEquals(b.to_string(), self.sr)
Ejemplo n.º 5
0
 def test_vectorwise(self):
     a = Babe().pull(string=self.s,
                     format='csv')
     a = a.typedetect()
     a.push_sql(table='test_table',
                database_kind='vectorwise',
                database='pybabe_test',
                drop_table=True,
                create_table=True)
     b = Babe().pull_sql(database_kind='vectorwise',
                         database='pybabe_test',
                         table='test_table')
     self.assertEquals(b.to_string(), self.s)
Ejemplo n.º 6
0
 def test_vectorwise(self):
     a = Babe().pull(stream=StringIO(self.s), format='csv')
     a = a.typedetect()
     a.push_sql(table='test_table',
                database_kind='vectorwise',
                database='pybabe_test',
                drop_table=True,
                create_table=True)
     b = Babe().pull_sql(database_kind='vectorwise',
                         database='pybabe_test',
                         table='test_table')
     buf = StringIO()
     b.push(stream=buf, format='csv', delimiter=',')
     self.assertEquals(buf.getvalue(), self.s)
Ejemplo n.º 7
0
    def test_pushsqlite_partition(self):
        a = Babe().pull(stream=StringIO(self.s), format='csv')
        a = a.typedetect()
        a.push_sql(table='test_table', database_kind='sqlite', database='test.sqlite', drop_table = True, create_table=True)

        a = Babe().pull(stream=StringIO(self.s2), format='csv')
        a = a.typedetect()
        a = a.partition(field='id')
        a.push_sql(table='test_table', database_kind='sqlite', database='test.sqlite', delete_partition=True)

        b = Babe().pull_sql(database_kind='sqlite', database='test.sqlite', table='test_table')
        b = b.sort(field="id")
        buf = StringIO()
        b.push(stream=buf, format='csv', delimiter=',')
        self.assertEquals(buf.getvalue(), self.sr)
Ejemplo n.º 8
0
    def test_pushsqlite_partition(self):
        a = Babe().pull(string=self.s, format='csv')
        a = a.typedetect()
        a.push_sql(table='test_table',
                   database_kind='sqlite',
                   database='test.sqlite',
                   drop_table=True,
                   create_table=True)

        a = Babe().pull(string=self.s2, format='csv')
        a = a.typedetect()
        a = a.partition(field='id')
        a.push_sql(table='test_table',
                   database_kind='sqlite',
                   database='test.sqlite',
                   delete_partition=True)

        b = Babe().pull_sql(database_kind='sqlite',
                            database='test.sqlite',
                            table='test_table')
        b = b.sort(field="id")
        self.assertEquals(b.to_string(), self.sr)
Ejemplo n.º 9
0
    def test_pushsqlite_partition(self):
        a = Babe().pull(stream=StringIO(self.s), format='csv')
        a = a.typedetect()
        a.push_sql(table='test_table',
                   database_kind='sqlite',
                   database='test.sqlite',
                   drop_table=True,
                   create_table=True)

        a = Babe().pull(stream=StringIO(self.s2), format='csv')
        a = a.typedetect()
        a = a.partition(field='id')
        a.push_sql(table='test_table',
                   database_kind='sqlite',
                   database='test.sqlite',
                   delete_partition=True)

        b = Babe().pull_sql(database_kind='sqlite',
                            database='test.sqlite',
                            table='test_table')
        b = b.sort(field="id")
        buf = StringIO()
        b.push(stream=buf, format='csv', delimiter=',')
        self.assertEquals(buf.getvalue(), self.sr)