Exemple #1
0
 def test_scan(self):
     with HTTMock(create_mock()):
         relation = MyriaRelation(FULL_NAME, connection=self.connection)
         json = relation._sink().to_json()
         optype = json['plan']['fragments'][0]['operators'][0]['opType']
         name = json['plan']['fragments'][0]['operators'][0]['opName']
         self.assertTrue('Scan' in optype)
         self.assertTrue(relation.name in name)
 def test_scan(self):
     with HTTMock(create_mock()):
         relation = MyriaRelation(FULL_NAME, connection=self.connection)
         json = relation._sink().to_json()
         optype = json['plan']['fragments'][0]['operators'][0]['opType']
         name = json['plan']['fragments'][0]['operators'][0]['opName']
         self.assertTrue('Scan' in optype)
         self.assertTrue(relation.name in name)
Exemple #3
0
    def test_load(self):
        state = {}
        with HTTMock(create_mock(state)):
            url = 'file:///foo.bar'
            relation = MyriaRelation(FULL_NAME, connection=self.connection)
            relation.load(url, schema=MyriaSchema(SCHEMA))
            plan = relation._sink().to_json()
            text = json.dumps(plan['plan']['fragments'][1]['operators'][0])
            self.assertTrue('FileScan' in text)
            self.assertTrue('TupleSource' in text)
            self.assertTrue(url in text)

            relation.execute()
            plan = state['query']
            text = json.dumps(plan['plan']['fragments'][0]['operators'][0])
            self.assertTrue('FileScan' in text)
            self.assertTrue('TupleSource' in text)
            self.assertTrue(url in text)
    def test_load(self):
        state = {}
        with HTTMock(create_mock(state)):
            url = 'file:///foo.bar'
            relation = MyriaRelation(FULL_NAME, connection=self.connection)
            relation.load(url, schema=MyriaSchema(SCHEMA))
            plan = relation._sink().to_json()
            text = json.dumps(plan['plan']['fragments'][1]['operators'][0])
            self.assertTrue('FileScan' in text)
            self.assertTrue('TupleSource' in text)
            self.assertTrue(url in text)

            relation.execute()
            plan = state['query']
            text = json.dumps(plan['plan']['fragments'][0]['operators'][0])
            self.assertTrue('FileScan' in text)
            self.assertTrue('TupleSource' in text)
            self.assertTrue(url in text)