uwdb / Cosette

Cosette is an automated SQL solver.
BSD 2-Clause "Simplified" License
662 stars 54 forks source link

Can not successfully run Cosette tests #79

Closed matthiastz closed 4 years ago

matthiastz commented 4 years ago

Hi, i tried using Cosette via checking out the source code and ran different python commands to first test the Cosette functionality.

E.g. the following is not working for me: python solver_test.py yields in

Ran 23 tests in 0.134s
FAILED (failures=21)

I did setup temp.cos with the following content:

-- define schema r with attributes a and b
schema s(a:int, b:int); 

table r(s);            -- define table r using schema s

query q1                -- define query q1 
`select x.a as a 
 from r x`;

query q2                -- define query q2 likewise
`select y.a as a 
 from r y`;

verify q1 q2;           -- does q1 equal to q2?

and did run python manual_test.py, which results in ERROR

the third test also does not work:

python2 run_calcite_examples.py

testReduceCastTimeUnchanged,ERROR
testIntersectToDistinct,ERROR
testEmptyProject2,ERROR
testEmptyFilterProjectUnion,ERROR
testSortProjectTranspose1,ERROR
testSortProjectTranspose2,ERROR
testSortProjectTranspose3,ERROR
testPullNull,ERROR
testReduceCastAndConsts,ERROR
testPushSemiJoinPastJoinRuleRight,ERROR
testPushCountNullableThroughUnion,ERROR
testEmptyAggregateEmptyKeyWithAggregateValuesRule,ERROR
testPullConstantThroughAggregateAllConst,ERROR
testReduceValuesUnderProjectFilter,ERROR
testMergeMinus,ERROR
testDecorrelateTwoExists,ERROR
testEmptyMinus,ERROR
testReduceValuesUnderProject,ERROR
testAggregateConstantKeyRule,ERROR
testExpandFilterExistsSimpleAnd,ERROR
testReduceValuesUnderFilter,ERROR
testReduceConstantsDup,ERROR
testAggregateProjectMerge,ERROR
testRemoveSemiJoin,ERROR
testPullConstantThroughUnion,ERROR
testWhereNotInCorrelated2,ERROR
testReduceNot,ERROR
testDistinctWithGrouping,ERROR
testWhereNotInCorrelated,ERROR
testMinusMergeRule,ERROR
testWhereInCorrelated,ERROR
testReduceConstantsNullEqualsOne,ERROR
testDistinctCountMultiple,ERROR
testSemiJoinRuleExists,ERROR
testWhereExpressionInCorrelated,ERROR
testExpandFilterInComposite,ERROR
testPullFilterThroughAggregateGroupingSets,ERROR
testReduceConstantsRequiresExecutor,ERROR
testTransitiveInferenceJoin3wayAgg,ERROR
testReduceConstantsProjectNullable,ERROR
testWhereOrSubQuery,ERROR
testTransitiveInferencePreventProjectPullUp,ERROR
testDecorrelateExists,ERROR
testTransitiveInferenceJoin3way,ERROR
testPushCountStarThroughUnion,ERROR
testRemoveSemiJoinRight,ERROR
testCustomColumnResolvingInNonCorrelatedSubQuery,ERROR
testReduceExpressionsNot,ERROR
testPushProjectPastInnerJoin,ERROR
testPushAggregateFunctionsThroughJoin,ERROR
testTransitiveInferenceProject,ERROR
testPushAvgThroughUnion,ERROR
testPushProjectPastFullJoinStrong,ERROR
testReduceConstantsCalc,ERROR
testReduceConstantsDup2,ERROR
testReduceConstantsNull,ERROR
testPushCountFilterThroughUnion,ERROR
testReduceConstantsNegatedInverted,ERROR
testPushSumCountStarGroupingSetsThroughUnion,ERROR
testPushSemiJoinPastJoinRuleLeft,ERROR
testExtractJoinFilterRule,ERROR
testPushAggregateThroughJoinDistinct,ERROR
testTransitiveInferenceFullOuterJoin,ERROR
testDecorrelateTwoIn,ERROR
testPushProjectPastLeftJoinSwapStrong,ERROR
testExpandFilterExistsSimple,ERROR
testPullConstantThroughAggregatePermutedConstGroupBy,ERROR
testPushSumCountStarThroughUnion,ERROR
testPushFilterWithRank,ERROR
testPushSumNullableGroupingSetsThroughUnion,ERROR
testMergeFilter,ERROR
testDistinctCountGroupingSets1,ERROR
testDistinctCountGroupingSets2,ERROR
testPushProjectPastSetOp,ERROR
testMergeMinusRightDeep,ERROR
testPushFilterPastAgg,ERROR
testPushProjectPastFullJoin,ERROR
testEmptyJoin,ERROR
testEmptySort,ERROR
testMultipleDistinctWithGrouping,ERROR
testReduceConstantsIsNull,ERROR
testTransitiveInferenceJoin,ERROR
testPushCountNullableGroupingSetsThroughUnion,ERROR
testPushProjectPastRightJoinStrong,ERROR
testPushProjectPastRightJoinSwapStrong,ERROR
testSemiJoinRuleRight,ERROR
testFullOuterJoinSimplificationToRightOuter,ERROR
testPushFilterPastAggTwo,ERROR
testPushAggregateSumNoGroup,ERROR
testPushProjectPastLeftJoin,ERROR
testSortUnionTranspose,ERROR
testReduceConstantsNegated,ERROR
testPushSemiJoinPastProject,ERROR
testPushFilterWithRankExpr,ERROR
testReduceNullableCase,ERROR
testEmptyAggregateEmptyKey,ERROR
testSortJoinTranspose1,ERROR
testSortJoinTranspose2,ERROR
testSortJoinTranspose3,ERROR
testSortJoinTranspose4,ERROR
testSortJoinTranspose5,ERROR
testUnionMergeRule,ERROR
testSemiJoinRule,ERROR
testSemiJoinTrim,ERROR
testTransitiveInferenceConstantEquiPredicate,ERROR
testReduceValuesToEmpty,ERROR
testPushProjectPastFilter,ERROR
testDistinctNonDistinctTwoAggregatesWithGrouping,ERROR
testAggregateGroupingSetsProjectMerge,ERROR
testPushFilterThroughSemiJoin,ERROR
testPushMinThroughUnion,ERROR
testPushSumConstantGroupingSetsThroughUnion,ERROR
testPushFilterPastAggWithGroupingSets1,ERROR
testPushFilterPastAggWithGroupingSets2,ERROR
testTransitiveInferenceUnion3way,ERROR
testCastInAggregateReduceFunctions,ERROR
testPullConstantThroughConstLast,ERROR
testIntersectToDistinctAll,ERROR
testEmptyJoinRight,ERROR
testTransitiveInferenceLeftOuterJoin,ERROR
testPushMaxNullableGroupingSetsThroughUnion,ERROR
testReduceConstants2,ERROR
testPushJoinThroughUnionOnRight,ERROR
testFullOuterJoinSimplificationToInner,ERROR
testPushAvgGroupingSetsThroughUnion,ERROR
testReduceOrCaseWhen,ERROR
testReduceAverage,ERROR
testMergeUnionAll,ERROR
testReduceCasts,ERROR
testLeftOuterJoinSimplificationToInner,ERROR
testPushSumNullableNOGBYThroughUnion,ERROR
testEmptyMinus2,ERROR
testPushAggregateThroughJoin1,ERROR
testPushAggregateThroughJoin2,ERROR
testPushAggregateThroughJoin3,ERROR
testPushAggregateThroughJoin4,ERROR
testPushAggregateThroughJoin5,ERROR
testReduceConstants,ERROR
testPushSumNullConstantThroughUnion,ERROR
testMergeJoinFilter,ERROR
testMergeUnionDistinct,ERROR
testStrengthenJoinType,ERROR
testPushAggregateSumThroughJoin,ERROR
testExpandFilterIn,ERROR
testReduceConstantsCaseEquals,ERROR
testTransitiveInferenceNoPullUpExprs,ERROR
testEmptyProject,ERROR
testTransitiveInferenceConjunctInPullUp,ERROR
testPullConstantThroughAggregateSimpleNonNullable,ERROR
testUnionToDistinctRule,ERROR
testPushSemiJoinPastFilter,ERROR
testPullAggregateThroughUnion,ERROR
testPullConstantIntoFilter,ERROR
testPushSumNullableThroughUnion,ERROR
testEmptyAggregate,ERROR
testTransitiveInferencePullUpThruAlias,ERROR
testTransitiveInferenceAggregate,ERROR
testEmptySortLimitZero,ERROR
testCastInAggregateExpandDistinctAggregatesRule,ERROR
testDistinctCount1,ERROR
testDistinctCount2,ERROR
testDistinctCount3,ERROR
testExpandProjectIn,ERROR
testReduceNullableCase2,ERROR
testPushCountStarGroupingSetsThroughUnion,ERROR
testDistinctNonDistinctAggregates,ERROR
testMergeSetOpMixed,ERROR
testDistinctNonDistinctAggregatesWithGrouping1,ERROR
testDistinctNonDistinctAggregatesWithGrouping2,ERROR
testReduceConstantsIsNotNull,ERROR
testPushMinGroupingSetsThroughUnion,ERROR
testPullConstantThroughAggregateConstGroupBy,ERROR
testPullConstantThroughAggregatePermuted,ERROR
testEmptyIntersect,ERROR
testPushProjectPastRightJoinSwap,ERROR
testPullConstantIntoProject,ERROR
testTransitiveInferenceUnionAlwaysTrue,ERROR
testReduceCompositeInSubQuery,ERROR
testMergeIntersect,ERROR
testPushSumConstantThroughUnion,ERROR
testAddRedundantSemiJoinRule,ERROR
testExpandProjectExists,ERROR
testRemoveSemiJoinWithFilter,ERROR
testRightOuterJoinSimplificationToInner,ERROR
testDistinctCountMixed,ERROR
testPushJoinCondDownToProject,ERROR
testRemoveSemiJoinRightWithFilter,ERROR
testFullOuterJoinSimplificationToLeftOuter,ERROR
testPullConstantThroughAggregatePermutedConstFirst,ERROR
testTransitiveInferenceUnion,ERROR
testPullConstantIntoJoin,ERROR
testReduceConstantsCaseEquals2,ERROR
testReduceConstantsCaseEquals3,ERROR
testExpandJoinScalar,ERROR
testPullConstantThroughAggregateAllLiterals,ERROR
testSwapOuterJoin,ERROR
testPushJoinThroughUnionOnLeft,ERROR
testMergeUnionMixed2,ERROR
testPushFilterPastAggThree,ERROR
testReduceConstantsEliminatesFilter,ERROR
testExpandFilterExists,ERROR
testAggregateProjectPullUpConstants,ERROR
testPushProjectPastFilter2,ERROR
testSemiJoinReduceConstants,ERROR
testExpandProjectScalar,ERROR
testDistinctCountMultipleNoGroup,ERROR
testExpandProjectInNullable,ERROR
testPullFilterThroughAggregate,ERROR
testAggregateConstantKeyRule2,ERROR
testAggregateConstantKeyRule3,ERROR
testPullConstantIntoJoin2,ERROR
testPushProjectPastInnerJoinStrong,ERROR
testPushProjectPastLeftJoinSwap,ERROR
testSemiJoinRuleFull,ERROR
testSemiJoinRuleLeft,ERROR
testExpandProjectInComposite,ERROR
testEmptyJoinLeft,ERROR
testReduceNestedCaseWhen,ERROR
testTransitiveInferenceRightOuterJoin,ERROR
testDistinctCountMixed2,ERROR
testPushSumNullConstantGroupingSetsThroughUnion,ERROR
testExpandFilterIn3Value,ERROR
testSortUnionTranspose2,ERROR
testSortUnionTranspose3,ERROR
testTransitiveInferenceComplexPredicate,ERROR
testExpandFilterScalar,ERROR
testAlreadyFalseEliminatesFilter,ERROR
testPushMaxNullableThroughUnion,ERROR
testPullConstantThroughUnion2,ERROR
testPullConstantThroughUnion3,ERROR
testPushProjectPastRightJoin,ERROR
testMergeUnionMixed,ERROR
stechu commented 4 years ago

Hi, Have you installed all the dependencies? It would be easier to run it on docker. See https://github.com/uwdb/Cosette/blob/master/Dockerfile

matthiastz commented 4 years ago

Hi stechu, thanks for the reply.

I followed your instruction and used the repos Dockerfile. This is what I did:

sudo docker image build .
sudo docker tag <image_name> cosette:1 # give repo and tag name for locally build docker image
sudo docker run -it -p 3434:8080 --name <image_name> cosette:1 # i guess the port directive is not really needed here

The main docker file "just" seems to install HoTT and Coq, is this correct? This is what my system looks like after docker run:

➜  Cosette git:(master) ✗ sudo docker run -it -p 3434:8080 --name a03760f720a7 cosette:1
root@21d66c7773bd:/# ls
HoTT  bin  boot  coq-8.5pl1  coq-8.5pl1.tar.gz  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
root@21d66c7773bd:/# 

I am not sure how to proceed further to use the Cosette solver locally. My goal is to run my own defined querys with Cosette either via .cos input files or even better with a frontend similar to https://demo.cosette.cs.washington.edu/. Could you please provide some more information on what steps I need to take to run the Cosette solver locally with Docker? Would be really appreciated, thanks.

Even did run sh init_docker.sh because i thought it is somehow related to the main docker file you mentioned, but that also does not seem to help much. Do I need to run FrontendDockerFile ?

matthiastz commented 4 years ago

Update:

I can somehow run Cosette locally now by doing the following: