예제 #1
0
            importFolderPath = "standard"
            hex_key = 'covtype.hex'
            csvPathname = importFolderPath + "/" + csvFilename
            parseResult = h2i.import_parse(bucket='home-0xdiag-datasets',
                                           path=csvPathname,
                                           schema='local',
                                           timeoutSecs=timeoutSecs,
                                           hex_key=hex_key,
                                           chunk_size=4194304 * 2,
                                           doSummary=False)
            pA = h2o_cmd.ParseObj(parseResult)

            iA = h2o_cmd.InspectObj(pA.parse_key)
            print iA.missingList, iA.labelList, iA.numRows, iA.numCols

            for i in range(1):
                print "Summary on column", i
                co = h2o_cmd.runSummary(key=hex_key, column=i)

            k = parseResult['frames'][0]['key']['name']
            # print "parseResult:", dump_json(parseResult)
            a_node = h2o.nodes[0]
            frames_result = a_node.frames(key=k, row_count=5)
            # print "frames_result from the first parseResult key", dump_json(frames_result)

            parseKeyIndexedCheck(frames_result, multiplyExpected)


if __name__ == '__main__':
    h2o.unit_main()
예제 #2
0
        assert isinstance(a, Xbase)
        assert not isinstance(a, KeyIndexed)
        assert not isinstance(a, Fcn)
        assert not isinstance(a, Assign)

        Assign(a, range(5))
        Assign(b, range(5))
        Assign(c, range(5))
        print "lastExecResult:", dump_json(h2o_xl.Xbase.lastExecResult)

        assert isinstance(a, Key)
        assert isinstance(b, Key)
        assert isinstance(c, Key)

        # print "Referring to non-existent rows causes a problem (AAIOBE)"
        # not any more..change it to legal case
        Assign(c[1], (a[2] + b[2]))
        ast = h2o_xl.Xbase.lastExecResult['ast']
        astExpected = "(= ([ %c1 #1 #0) (+ ([ %a1 #2 #0) ([ %b1 #2 #0)))"
        assert ast==astExpected, "Actual: %s    Expected: %s" % (ast, astExpected)

        # print "\nDoes the keyWriteHistoryList work?"
        for k in Xbase.keyWriteHistoryList:
            print k

        h2o.check_sandbox_for_errors()


if __name__ == '__main__':
    h2o.unit_main()