repository stringclasses 156 values | issue title stringlengths 1 1.01k ⌀ | labels stringclasses 8 values | body stringlengths 1 270k ⌀ |
|---|---|---|---|
prestodbpresto | skip partition prune during predicate pushdown for query that can t benefit from it | Enhancement | the partition pruning logic trigger by the predicate pushdown optimizer can get very expensive for table with hundred of thousand of partition there be some query that can t benefit from partition pruning at all so try to enumerate they eagerly be costly and introduce unnecessary latency e g sql select from t limit 10 sql select from t where pre limit 10 here be a couple of idea on how we could improve this further analysis be need to determine whether they be reasonable change and what impact they may have keep track of whether the pushdown optimizer need partition information as it walk down the plan e g due to join or where clause and only ask for partition from the splitmanager if necessary avoid enumerate partition in connector if the effective predicate be over non partition key column |
prestodbpresto | query input row size stat not track properly for join query | Bug | the query level stat only include the row size from the leaf stage the should include the input for all stage that perform table scan for example 1 20 130 m rows 14 1 gb 1 64 m rows s 182 mb s stage row row s bytes bytes s queue run do 0 r 0 0 0b 0b 0 1 0 1 r 0 0 0b 0b 0 20 0 2 s 13b 163 m 1 82 t 23 4 g 1478 8870 27560 3 f 43 1 m 0 2 38 g 0b 0 0 20 4 f 130 m 0 14 1 g 0b 0 0 2363 the bug be possibly due to the following check in querystatemachine getqueryinfo line 193 java if stageinfo getsubstage isempty |
prestodbpresto | refresh partition information in batch | Enhancement | currently the partition cache in cachinghivemetastore be access via getall which do a single request to the metastore for each call once the entry be in the cache though the background refresh task fetch they one at a time we should update the implementation to batch the background request to refresh base on time count and issue a single request to the metastore |
prestodbpresto | implement hive acid table support | Enhancement | hive 0 14 introduce acid table info in hive wiki hive transaction these table be not compatible with exist code because directory layout be different these table will have subdirectory for different version basis and addendum of the datum more than word an example for example for a table foo command in hive 0 jdbc hive2 nc h04 10000 casino dfs ls hdfs nc h04 user hive warehouse casino db foo dfs output find 1 item drwxr xr x hduser supergroup 0 2014 11 12 14 53 hdfs nc h04 user hive warehouse casino db foo base 0000077 2 row select 0 065 second if I add some value or modify it with update or delete I have that addendum directory 0 jdbc hive2 nc h04 10000 casino dfs ls hdfs nc h04 user hive warehouse casino db foo dfs output find 4 item drwxr xr x hduser supergroup 0 2014 11 12 14 53 hdfs nc h04 user hive warehouse casino db foo base 0000077 drwxr xr x hduser supergroup 0 2014 11 14 11 58 hdfs nc h04 user hive warehouse casino db foo delta 0000079 0000079 drwxr xr x hduser supergroup 0 2014 11 14 11 58 hdfs nc h04 user hive warehouse casino db foo delta 0000081 0000081 drwxr xr x hduser supergroup 0 2014 11 14 11 58 hdfs nc h04 user hive warehouse casino db foo delta 0000082 0000082 5 row select 0 017 second a quick fix could be to only use the last base of the table what be acid table 1 a table with transactional table property set to value true low case be important what we can do a simple algorithm 1 we can easily know if a table be acid with transactional table property 2 if a hive table be acid we can consider only the last consolidated base if table have transactional property set to true 1 get list of directory like base 7 digit 2 only consider the last one instead of the root directory |
prestodbpresto | make row type comparable | Enhancement | the row type should be comparable if and only if all its field type be comparable |
prestodbpresto | locationawareschedule false should not override split s remotely accessible flag | Bug | in the current implementation if location aware scheduling be turn off node will be pick at random regardless of whether the split indicate that it s not remotely accessible this be wrong as it will result in worker not be able to access the datum they be assign to process |
prestodbpresto | count star on sys node table return error | Bug | this be in version 0 77 not sure if it have be fix since presto default select count from sys node query 20141108 143132 00003 rrx9x fail 2 node split 1 total 0 do 0 00 cpu time 0 0s total 0 rows s 0b s 0 active per node 0 0 parallelism 0 rows s 0b s parallelism 0 0 0 00 0 row 0b 0 rows s 0b s query 20141108 143132 00003 rrx9x fail must provide at least one column java lang illegalargumentexception must provide at least one column at com google common base precondition checkargument precondition java 125 at com facebook presto connector system systemrecordsetprovider getrecordset systemrecordsetprovid java 55 at com facebook presto split recordpagesourceprovider createpagesource recordpagesourceprovider java 40 at com facebook presto split pagesourcemanager createpagesource pagesourcemanager java 56 at com facebook presto operator tablescanoperator addsplit tablescanoperator java 150 at com facebook presto operator driver processnewsource driver java 252 at com facebook presto operator driver processnewsource driver java 217 at com facebook presto operator driver access 300 driver java 53 at com facebook presto operator driver driverlockresult close driver java 501 at com facebook presto operator driver updatesource driver java 195 at com facebook presto execution sqltaskexecution driversplitrunnerfactory createdriver sqltaskexecution java 447 at com facebook presto execution sqltaskexecution driversplitrunnerfactory access 1500 sqltaskexecution java 414 at com facebook presto execution sqltaskexecution driversplitrunner processfor sqltaskexecution java 535 at com facebook presto execution taskexecutor prioritizedsplitrunner process taskexecutor java 444 at com facebook presto execution taskexecutor runner run taskexecutor java 578 at java util concurrent threadpoolexecutor runworker threadpoolexecutor java 1145 at java util concurrent threadpoolexecutor worker run threadpoolexecutor java 615 at java lang thread run thread java 744 |
prestodbpresto | table create or insert can succeed even if the query fail | Bug | due to how the operator system work the finish method on tablecommitoperator can be call even if the query fail cause it to erroneously commit the table creation or insert operation |
prestodbpresto | add bitwise function | Enhancement | we need to figure out how various type get convert to bit the sql standard have a bit and bit vary type which may be useful here |
prestodbpresto | fix o n 2 loop in inputextractor visittablescan | Enhancement | the loop in visittablescan do one metadata lookup for each column reference by the tablescan node the implementation of getcolumnmetadata be o n for some connector e g hive result in o n 2 overall fix this may require update the spi to be able to return multiple column metadata entry in one call |
prestodbpresto | json array get do not work for non scalar | Bug | presto search select json array get hello world 0 col0 null 1 row |
prestodbpresto | nan in array or map not handle correctly | Bug | select array sqrt 1 the above query should work but instead fail with an error |
prestodbpresto | npe writting null map or array in hiverecordsink | Bug | java lang nullpointerexception io airlift slice precondition checknotnull precondition java 30 io airlift slice slice copiedbuffer slice java 222 io airlift slice slice utf8slice slice java 230 com facebook presto hive hiverecordsink append hiverecordsink java 217 com facebook presto hive hiverecordsink appendnull hiverecordsink java 152 com facebook presto operator tablewriteroperator writefield tablewriteroperator java 189 com facebook presto operator tablewriteroperator addinput tablewriteroperator java 179 com facebook presto operator driver process driver java 336 com facebook presto operator driver processfor driver java 272 com facebook presto execution sqltaskexecution driversplitrunner processfor sqltaskexecution java 557 com facebook presto execution taskexecutor prioritizedsplitrunner process taskexecutor java 444 com facebook presto execution taskexecutor runner run taskexecutor java 578 java util concurrent threadpoolexecutor runworker threadpoolexecutor java 1142 java util concurrent threadpoolexecutor worker run threadpoolexecutor java 617 java lang thread run thread java 745 |
prestodbpresto | create sql domain for sphinx | Enhancement | sphinx use domain for thing like function documentation and reference we use the python domain as the default domain for the presto documentation but this be problematic because python function do not have argument type return type or overload we should write a new sql domain for sphinx to properly support sql function semantic |
prestodbpresto | presto cli sql folding should replace end of line comment with c style comment | Enhancement | this query presto default select 4 5 6 7 fold to presto default select 4 5 6 7 which can t be edit instead we should fold it to presto default select 4 5 6 7 |
prestodbpresto | null partition key break hive partition pruning | Bug | if the table have a partition key like key hive default partition the follow query select key count from table group by 1 return result like key col1 window 1 null 2 ios 3 android 4 4 row but the follow query return no row select key count from table where key be null group by 1 |
prestodbpresto | implement corr covar etc aggregation function | Enhancement | from the sql specification section 4 15 the binary aggregate function take a pair of argument the and the which be both s any row in which either argument evaluate to the null value be remove from the group if there be no row remain in the group then the result of regr count be 0 zero and the other binary aggregate function result in the null value otherwise the computation conclude and the result be if covar pop be specify then the population covariance define as the sum of product of the difference of from its mean time the difference of from its mean divide by the number of row remain if covar samp be specify then the sample covariance define as the sum of product of the difference of from its mean time the difference of from its mean divide by the number of row remain minus 1 one if corr be specify then the correlation coefficient define as the ratio of the population covariance divide by the product of the population standard deviation of and the population standard deviation of if regr slope be specify then the slope of the least square fit linear equation determine by the pair if regr intercept be specify then the y intercept of the least square fit linear equation determine by the pair |
prestodbpresto | support for skip header line count property for hive table | Enhancement | we have text table with skip header line count property |
prestodbpresto | exception when use subquery expression in aggregation query | Bug | the follow query should fail during analysis with a proper error e g must be an aggregate expression or appear in group by clause but it fail with an internal error instead sql select a value 1 group by 1 query 20141017 183915 11402 sgybh fail aggregation analysis not yet implement for com facebook presto sql tree subqueryexpression java lang unsupportedoperationexception aggregation analysis not yet implement for com facebook presto sql tree subqueryexpression at com facebook presto sql analyzer aggregationanalyzer visitor visitexpression aggregationanalyzer java 152 at com facebook presto sql analyzer aggregationanalyzer visitor visitexpression aggregationanalyzer java 134 at com facebook presto sql tree astvisitor visitsubqueryexpression astvisitor java 329 at com facebook presto sql tree subqueryexpression accept subqueryexpression java 34 at com facebook presto sql tree astvisitor process astvisitor java 24 at com facebook presto sql analyzer aggregationanalyzer visitor process aggregationanalyzer java 415 at com facebook presto sql analyzer aggregationanalyzer analyze aggregationanalyzer java 129 at com facebook presto sql analyzer tupleanalyzer verifyaggregation tupleanalyzer java 980 at com facebook presto sql analyzer tupleanalyzer analyzeaggregation tupleanalyzer java 943 at com facebook presto sql analyzer tupleanalyzer visitqueryspecification tupleanalyzer java 349 at com facebook presto sql analyzer tupleanalyzer visitqueryspecification tupleanalyzer java 122 at com facebook presto sql tree queryspecification accept queryspecification java 99 at com facebook presto sql tree astvisitor process astvisitor java 24 at com facebook presto sql analyzer statementanalyzer visitquery statementanalyzer java 533 at com facebook presto sql analyzer statementanalyzer visitquery statementanalyzer java 106 at com facebook presto sql tree query accept query java 80 at com facebook presto sql tree astvisitor process astvisitor java 24 at com facebook presto sql analyzer analyzer analyze analyzer java 52 at com facebook presto execution sqlqueryexecution doanalyzequery sqlqueryexecution java 204 at com facebook presto execution sqlqueryexecution analyzequery sqlqueryexecution java 189 at com facebook presto execution sqlqueryexecution start sqlqueryexecution java 150 at com facebook presto execution sqlquerymanager querystarter querysubmitter 2 run sqlquerymanager java 465 at java util concurrent threadpoolexecutor runworker threadpoolexecutor java 1145 at java util concurrent threadpoolexecutor worker run threadpoolexecutor java 615 at java lang thread run thread java 745 |
prestodbpresto | exception when use subscript operator in aggregation query | Bug | the follow query should fail during analysis with a proper error e g must be an aggregate expression or appear in group by clause but it fail with an internal error instead sql select a array 1 2 3 1 group by 1 query 20141017 183802 11391 sgybh fail aggregation analysis not yet implement for com facebook presto sql tree subscriptexpression java lang unsupportedoperationexception aggregation analysis not yet implement for com facebook presto sql tree subscriptexpression at com facebook presto sql analyzer aggregationanalyzer visitor visitexpression aggregationanalyzer java 152 at com facebook presto sql analyzer aggregationanalyzer visitor visitexpression aggregationanalyzer java 134 at com facebook presto sql tree astvisitor visitsubscriptexpression astvisitor java 314 at com facebook presto sql tree subscriptexpression accept subscriptexpression java 35 at com facebook presto sql tree astvisitor process astvisitor java 24 at com facebook presto sql analyzer aggregationanalyzer visitor process aggregationanalyzer java 415 at com facebook presto sql analyzer aggregationanalyzer analyze aggregationanalyzer java 129 at com facebook presto sql analyzer tupleanalyzer verifyaggregation tupleanalyzer java 980 at com facebook presto sql analyzer tupleanalyzer analyzeaggregation tupleanalyzer java 943 at com facebook presto sql analyzer tupleanalyzer visitqueryspecification tupleanalyzer java 349 at com facebook presto sql analyzer tupleanalyzer visitqueryspecification tupleanalyzer java 122 at com facebook presto sql tree queryspecification accept queryspecification java 99 at com facebook presto sql tree astvisitor process astvisitor java 24 at com facebook presto sql analyzer statementanalyzer visitquery statementanalyzer java 533 at com facebook presto sql analyzer statementanalyzer visitquery statementanalyzer java 106 at com facebook presto sql tree query accept query java 80 at com facebook presto sql tree astvisitor process astvisitor java 24 at com facebook presto sql analyzer analyzer analyze analyzer java 52 at com facebook presto execution sqlqueryexecution doanalyzequery sqlqueryexecution java 204 at com facebook presto execution sqlqueryexecution analyzequery sqlqueryexecution java 189 at com facebook presto execution sqlqueryexecution start sqlqueryexecution java 150 at com facebook presto execution sqlquerymanager querystarter querysubmitter 2 run sqlquerymanager java 465 at java util concurrent threadpoolexecutor runworker threadpoolexecutor java 1145 at java util concurrent threadpoolexecutor worker run threadpoolexecutor java 615 at java lang thread run thread java 745 |
prestodbpresto | describe a drop hive table show zero row | Bug | describe a drop hive table that have be cache result in the describe show zero row rather than table do not exist presto desc some table column type null partition key comment 0 row |
prestodbpresto | array be not comparable | Enhancement | array should be comparable and orderable so that they can be use in group by expression order by clause etc the and hashcode operator for a type array be define iff they be define for t give two array a array and b array the operator list above can be apply between a and b as long as the correspond operator can be apply to t and u a b if they have the same cardinality and every element in a be equal to the correspond element in b I e a b cardinality a cardinality b and for every 1 I cardinality a a I b I a b if they share a possibly empty prefix follow by an element in a less than the correspond element in b or a be a prefix of b I e a b if for some 1 k min cardinality a cardinality b a I b I for every I k and a k b k or for every 1 I cardinality a a I b I and cardinality a cardinality b |
prestodbpresto | nullpointerexception when try to explain rename | Bug | this result in an exception explain alter table order rename to rename order java lang nullpointerexception com facebook presto sql tree astvisitor process astvisitor java 24 com facebook presto sql planner logicalplanner createrelationplan logicalplanner java 173 com facebook presto sql planner logicalplanner plan logicalplanner java 79 com facebook presto sql analyzer queryexplainer getlogicalplan queryexplainer java 104 com facebook presto sql analyzer queryexplainer getplan queryexplainer java 66 com facebook presto sql analyzer statementanalyzer getqueryplan statementanalyzer java 510 com facebook presto sql analyzer statementanalyzer visitexplain statementanalyzer java 479 com facebook presto sql analyzer statementanalyzer visitexplain statementanalyzer java 106 com facebook presto sql tree explain accept explain java 53 com facebook presto sql tree astvisitor process astvisitor java 24 com facebook presto sql analyzer analyzer analyze analyzer java 52 com facebook presto execution sqlqueryexecution doanalyzequery sqlqueryexecution java 204 com facebook presto execution sqlqueryexecution analyzequery sqlqueryexecution java 189 com facebook presto execution sqlqueryexecution start sqlqueryexecution java 150 com facebook presto execution sqlquerymanager querystarter querysubmitter 2 run sqlquerymanager java 465 java util concurrent threadpoolexecutor runworker threadpoolexecutor java 1145 java util concurrent threadpoolexecutor worker run threadpoolexecutor java 615 java lang thread run thread java 745 |
prestodbpresto | hiveclient getpartition break with hive default partition | Bug | hiveclient getpartition do not properly handle null partition example 20141013 191538 19058 tgxh6 for input string hive default partition java lang numberformatexception java lang numberformatexception forinputstring numberformatexception java 65 java lang long parselong long java 441 java lang long parselong long java 483 com facebook presto hive hiveclient 4 apply hiveclient java 1345 com facebook presto hive hiveclient 4 apply hiveclient java 1309 com google common collect iterator 8 transform iterator java 794 com google common collect transformediterator next transformediterator java 48 com google common collect iterator 7 computenext iterator java 646 com google common collect abstractiterator trytocomputenext abstractiterator java 143 com google common collect abstractiterator hasnext abstractiterator java 138 com google common collect iterator 7 computenext iterator java 645 com google common collect abstractiterator trytocomputenext abstractiterator java 143 com google common collect abstractiterator hasnext abstractiterator java 138 com google common collect immutablecollection builder addall immutablecollection java 300 com google common collect immutablelist builder addall immutablelist java 691 com google common collect immutablelist copyof immutablelist java 275 com google common collect immutablelist copyof immutablelist java 226 com google common collect fluentiterable tolist fluentiterable java 334 com facebook presto hive hiveclient getpartition hiveclient java 1032 |
prestodbpresto | exception in pruneunreferencedoutput with unnest | Bug | sql select 1 from value array 1 as t a cross join unn a java lang illegalargumentexception unnestsymbol be empty at com google common base precondition checkargument precondition java 125 at com facebook presto sql planner plan unnestnode unnestnode java 50 at com facebook presto sql planner optimizations pruneunreferencedoutputs rewriter rewriteunnest pruneunreferencedoutputs java 309 at com facebook presto sql planner optimizations pruneunreferencedoutputs rewriter rewriteunnest pruneunreferencedoutputs java 94 at com facebook presto sql planner plan planrewriter rewritingvisitor visitunnest planrewriter java 357 at com facebook presto sql planner plan planrewriter rewritingvisitor visitunnest planrewriter java 65 at com facebook presto sql planner plan unnestnode accept unnestnode java 94 at com facebook presto sql planner plan planrewriter rewrite planrewriter java 42 at com facebook presto sql planner optimizations pruneunreferencedoutputs rewriter rewriteproject pruneunreferencedoutput java 328 at com facebook presto sql planner optimizations pruneunreferencedoutputs rewriter rewriteproject pruneunreferencedoutput java 94 at com facebook presto sql planner plan planrewriter rewritingvisitor visitproject planrewriter java 236 at com facebook presto sql planner plan planrewriter rewritingvisitor visitproject planrewriter java 65 at com facebook presto sql planner plan projectnode accept projectnode java 78 at com facebook presto sql planner plan planrewriter rewrite planrewriter java 42 at com facebook presto sql planner optimizations pruneunreferencedoutputs rewriter rewriteoutput pruneunreferencedoutputs java 337 at com facebook presto sql planner optimizations pruneunreferencedoutputs rewriter rewriteoutput pruneunreferencedoutputs java 94 at com facebook presto sql planner plan planrewriter rewritingvisitor visitoutput planrewriter java 274 at com facebook presto sql planner plan planrewriter rewritingvisitor visitoutput planrewriter java 65 at com facebook presto sql planner plan outputnode accept outputnode java 79 at com facebook presto sql planner plan planrewriter rewrite planrewriter java 42 at com facebook presto sql planner plan planrewriter rewritewith planrewriter java 31 at com facebook presto sql planner optimization pruneunreferencedoutput optimize pruneunreferencedoutput java 91 at com facebook presto sql planner logicalplanner plan logicalplanner java 88 at com facebook presto execution sqlqueryexecution doanalyzequery sqlqueryexecution java 208 at com facebook presto execution sqlqueryexecution analyzequery sqlqueryexecution java 189 at com facebook presto execution sqlqueryexecution start sqlqueryexecution java 150 at com facebook presto execution sqlquerymanager querystarter querysubmitter 2 run sqlquerymanager java 465 at java util concurrent threadpoolexecutor runworker threadpoolexecutor java 1145 at java util concurrent threadpoolexecutor worker run threadpoolexecutor java 615 at java lang thread run thread java 745 |
prestodbpresto | nullpointerexception verify schema in hiveclient | Bug | the code that verify the table schema match the partition schema can throw a npe at l1068 one of the list be likely null com facebook presto spi prestoexception hive unknown error at com facebook presto hive hivesplitsourceprovider hivesplitsource propagateprestoexception hivesplitsourceprovider java 589 na na at com facebook presto hive hivesplitsourceprovider hivesplitsource getnextbatch hivesplitsourceprovider java 532 na na at com facebook presto execution connectorawaresplitsource getnextbatch connectorawaresplitsource java 46 presto main 0 76 jar 0 76 at com facebook presto execution sqlstageexecution schedulesourcepartitionednode sqlstageexecution java 633 presto main 0 76 jar 0 76 at com facebook presto execution sqlstageexecution starttask sqlstageexecution java 554 presto main 0 76 jar 0 76 at com facebook presto execution sqlstageexecution access 200 sqlstageexecution java 93 presto main 0 76 jar 0 76 at com facebook presto execution sqlstageexecution 4 run sqlstageexecution java 526 presto main 0 76 jar 0 76 at java util concurrent executors runnableadapter call executor java 471 na 1 7 0 51 at java util concurrent futuretask run futuretask java 262 na 1 7 0 51 at java util concurrent threadpoolexecutor runworker threadpoolexecutor java 1145 na 1 7 0 51 at java util concurrent threadpoolexecutor worker run threadpoolexecutor java 615 na 1 7 0 51 at java lang thread run thread java 744 na 1 7 0 51 cause by java lang nullpointerexception null at com facebook presto hive hiveclient 1 apply hiveclient java 1068 na na at com facebook presto hive hiveclient 1 apply hiveclient java 1039 na na at com google common collect iterator 8 transform iterator java 794 guava 16 0 1 jar na at com google common collect transformediterator next transformediterator java 48 guava 16 0 1 jar na at com google common collect transformediterator next transformediterator java 48 guava 16 0 1 jar na at com google common collect iterator 5 hasnext iterator java 543 guava 16 0 1 jar na at com facebook presto hive hivesplitsourceprovider loadpartitionsplit hivesplitsourceprovider java 190 na na at com facebook presto hive hivesplitsourceprovider access 100 hivesplitsourceprovider java 80 na na at com facebook presto hive hivesplitsourceprovider 2 run hivesplitsourceprovider java 172 na na at java util concurrent executors runnableadapter call executor java 471 na 1 7 0 51 at java util concurrent futuretask run futuretask java 262 na 1 7 0 51 at com facebook presto hive util boundedexecutor executeormerge boundedexecutor java 82 na na at com facebook presto hive util boundedexecutor access 000 boundedexecutor java 41 na na at com facebook presto hive util boundedexecutor 1 run boundedexecutor java 53 na na 3 common frame omit |
prestodbpresto | analyzer fail to catch usage of window function without over clause | Bug | a query like sql select row number fail with this exception java lang illegalstateexception not a scalar function or operator at com google common base precondition checkstate precondition java 176 at com facebook presto metadata functioninfo getmethodhandle functioninfo java 199 at com facebook presto sql planner expressioninterpreter visitor visitfunctioncall expressioninterpreter java 637 at com facebook presto sql tree functioncall accept functioncall java 67 at com facebook presto sql tree astvisitor process astvisitor java 24 at com facebook presto sql planner expressioninterpreter optimize expressioninterpreter java 141 at com facebook presto sql planner optimizations simplifyexpression rewriter simplifyexpression simplifyexpression java 129 at com facebook presto sql planner optimization simplifyexpression rewriter access 000 simplifyexpression java 68 at com facebook presto sql planner optimization simplifyexpression rewriter 1 apply simplifyexpression java 120 at com facebook presto sql planner optimization simplifyexpression rewriter 1 apply simplifyexpression java 116 at com google common collect map 7 transformentry map java 1810 at com google common collect map 10 getvalue map java 1855 at com google common collect immutablemap copyof immutablemap java 292 at com facebook presto sql planner optimizations simplifyexpression rewriter rewriteproject simplifyexpression java 88 at com facebook presto sql planner optimizations simplifyexpression rewriter rewriteproject simplifyexpression java 68 at com facebook presto sql planner plan planrewriter rewritingvisitor visitproject planrewriter java 236 at com facebook presto sql planner plan planrewriter rewritingvisitor visitproject planrewriter java 65 at com facebook presto sql planner plan projectnode accept projectnode java 78 at com facebook presto sql planner plan planrewriter rewrite planrewriter java 42 at com facebook presto sql planner optimizations simplifyexpression rewriter rewriteproject simplifyexpression java 87 at com facebook presto sql planner optimizations simplifyexpression rewriter rewriteproject simplifyexpression java 68 at com facebook presto sql planner plan planrewriter rewritingvisitor visitproject planrewriter java 236 at com facebook presto sql planner plan planrewriter rewritingvisitor visitproject planrewriter java 65 at com facebook presto sql planner plan projectnode accept projectnode java 78 at com facebook presto sql planner plan planrewriter rewrite planrewriter java 42 at com facebook presto sql planner optimizations simplifyexpression rewriter rewriteproject simplifyexpression java 87 at com facebook presto sql planner optimizations simplifyexpression rewriter rewriteproject simplifyexpression java 68 at com facebook presto sql planner plan planrewriter rewritingvisitor visitproject planrewriter java 236 at com facebook presto sql planner plan planrewriter rewritingvisitor visitproject planrewriter java 65 at com facebook presto sql planner plan projectnode accept projectnode java 78 at com facebook presto sql planner plan planrewriter rewrite planrewriter java 42 at com facebook presto sql planner optimizations simplifyexpression rewriter rewriteproject simplifyexpression java 87 at com facebook presto sql planner optimizations simplifyexpression rewriter rewriteproject simplifyexpression java 68 at com facebook presto sql planner plan planrewriter rewritingvisitor visitproject planrewriter java 236 at com facebook presto sql planner plan planrewriter rewritingvisitor visitproject planrewriter java 65 at com facebook presto sql planner plan projectnode accept projectnode java 78 at com facebook presto sql planner plan planrewriter rewrite planrewriter java 42 at com facebook presto sql planner plan planrewriter rewritingvisitor visitoutput planrewriter java 280 at com facebook presto sql planner plan planrewriter rewritingvisitor visitoutput planrewriter java 65 at com facebook presto sql planner plan outputnode accept outputnode java 79 at com facebook presto sql planner plan planrewriter rewrite planrewriter java 42 at com facebook presto sql planner plan planrewriter rewritewith planrewriter java 31 at com facebook presto sql planner plan planrewriter rewritewith planrewriter java 26 at com facebook presto sql planner optimization simplifyexpression optimize simplifyexpression java 65 at com facebook presto sql planner logicalplanner plan logicalplanner java 88 at com facebook presto execution sqlqueryexecution doanalyzequery sqlqueryexecution java 208 at com facebook presto execution sqlqueryexecution analyzequery sqlqueryexecution java 189 at com facebook presto execution sqlqueryexecution start sqlqueryexecution java 150 at com facebook presto execution sqlquerymanager querystarter querysubmitter 2 run sqlquerymanager java 465 at java util concurrent threadpoolexecutor runworker threadpoolexecutor java 1145 at java util concurrent threadpoolexecutor worker run threadpoolexecutor java 615 at java lang thread run thread java 745 this should be catch during analysis and should fail with a message like window function require over clause |
prestodbpresto | compilation for try cast be break | Bug | the exception handling be completely break because exception clear the stack it need to be in a separate method this query reproduce it select concat foo try cast x as varchar from value 1 a x exception java lang verifyerror instruction type do not match stack map |
prestodbpresto | select count with aggregation subquery throw arrayindexoutofboundsexception | Bug | presto select count from select count 1 query 20140910 204334 54189 w8f29 fail 1 node split 1 total 0 do 0 00 cpu time 0 0s total 0 rows s 0b s 0 active per node 0 0 parallelism 0 rows s 0b s parallelism 0 0 0 01 1 row 0b 0 rows s 0b s query 20140910 204334 54189 w8f29 fail 0 java lang arrayindexoutofboundsexception 0 at com facebook presto operator page page java 34 at com facebook presto operator aggregationoperator getoutput aggregationoperator java 168 at com facebook presto operator driver process driver java 329 at com facebook presto operator driver processfor driver java 271 at com facebook presto execution sqltaskexecution driversplitrunner processfor sqltaskexecution java 679 at com facebook presto execution taskexecutor prioritizedsplitrunner process taskexecutor java 444 at com facebook presto execution taskexecutor runner run taskexecutor java 578 at java util concurrent threadpoolexecutor runworker threadpoolexecutor java 1145 at java util concurrent threadpoolexecutor worker run threadpoolexecutor java 615 at java lang thread run thread java 744 |
prestodbpresto | jmx connector do not render array properly | Bug | for example the inputargument column from java lang type runtime with the new array support it might be possible to return these as real array otherwise we should properly convert they to string |
prestodbpresto | exception during plan with duplicate column in order by clause | Bug | select x x from select 1 x order by 1 2 query 20140902 180334 61089 w8f29 fail multiple entry with same key x 2 asc null last and x 2 asc null last java lang illegalargumentexception multiple entry with same key x 2 asc null last and x 2 asc null last at com google common collect immutablemap checknoconflict immutablemap java 150 at com google common collect regularimmutablemap checknoconflictinbucket regularimmutablemap java 104 at com google common collect regularimmutablemap regularimmutablemap java 70 at com google common collect immutablemap builder build immutablemap java 254 at com facebook presto sql planner queryplanner sort queryplanner java 576 at com facebook presto sql planner queryplanner sort queryplanner java 551 at com facebook presto sql planner queryplanner visitqueryspecification queryplanner java 134 at com facebook presto sql planner queryplanner visitqueryspecification queryplanner java 73 at com facebook presto sql tree queryspecification accept queryspecification java 99 at com facebook presto sql tree astvisitor process astvisitor java 24 at com facebook presto sql planner relationplanner visitqueryspecification relationplanner java 256 at com facebook presto sql planner relationplanner visitqueryspecification relationplanner java 80 at com facebook presto sql tree queryspecification accept queryspecification java 99 at com facebook presto sql tree astvisitor process astvisitor java 24 at com facebook presto sql planner queryplanner planquerybody queryplanner java 143 at com facebook presto sql planner queryplanner visitquery queryplanner java 100 at com facebook presto sql planner queryplanner visitquery queryplanner java 73 at com facebook presto sql tree query accept query java 80 at com facebook presto sql tree astvisitor process astvisitor java 24 at com facebook presto sql planner relationplanner visitquery relationplanner java 243 at com facebook presto sql planner relationplanner visitquery relationplanner java 80 at com facebook presto sql tree query accept query java 80 at com facebook presto sql tree astvisitor process astvisitor java 24 at com facebook presto sql planner logicalplanner createrelationplan logicalplanner java 173 at com facebook presto sql planner logicalplanner plan logicalplanner java 79 at com facebook presto execution sqlqueryexecution doanalyzequery sqlqueryexecution java 202 at com facebook presto execution sqlqueryexecution analyzequery sqlqueryexecution java 183 at com facebook presto execution sqlqueryexecution start sqlqueryexecution java 144 at com facebook presto execution sqlquerymanager querystarter run sqlquerymanager java 397 at java util concurrent executors runnableadapter call executor java 471 at java util concurrent futuretask run futuretask java 262 at java util concurrent threadpoolexecutor runworker threadpoolexecutor java 1145 at java util concurrent threadpoolexecutor worker run threadpoolexecutor java 615 at java lang thread run thread java 744 |
prestodbpresto | query hang due to miss tasksource update in driver | Bug | driver can leave source update stick in newsource forever this hang the query since the task will never see the nomoresplit message I believe this be cause by a race where a tasksource be add between the call to processnewsource and the unlock in driverlockresult close the tasksource get queue in newsource but can not get the lock because be be hold the state machine design be flawed and will need to be redesign |
prestodbpresto | first value issue in 0 75 work fine in 0 74 | Bug | hello after upgrade from 0 74 to 0 75 the first value function do not work inside from if where filter give no row e g where 1 1 the error be expect 1 argument for function first value but get 0 this give an error select from select first value e name over partition by user uuid order by e create at asc from event e where 1 1 without from no error select first value e name over partition by user uuid order by e create at asc from event e where 1 1 also no error if where return row where 1 1 select from select first value e name over partition by user uuid order by e create at asc from event e where 1 1 |
prestodbpresto | indexjoinoptimizer break cross join | Bug | explain select from select 2 a x cross join select 2 a y query 20140812 190120 14773 pycet fail lookupsymbol can not be empty java lang illegalargumentexception lookupsymbol can not be empty at com google common base precondition checkargument precondition java 125 at com facebook presto sql planner optimization indexjoinoptimizer indexsourcerewriter context indexjoinoptimizer java 352 at com facebook presto sql planner optimization indexjoinoptimizer indexsourcerewriter rewritewithindex indexjoinoptimizer java 226 at com facebook presto sql planner optimizations indexjoinoptimizer rewriter rewritejoin indexjoinoptimizer java 107 at com facebook presto sql planner optimizations indexjoinoptimizer rewriter rewritejoin indexjoinoptimizer java 84 at com facebook presto sql planner plan planrewriter rewritingvisitor visitjoin planrewriter java 384 at com facebook presto sql planner plan planrewriter rewritingvisitor visitjoin planrewriter java 65 at com facebook presto sql planner plan joinnode accept joinnode java 139 at com facebook presto sql planner plan planrewriter rewrite planrewriter java 42 at com facebook presto sql planner plan planrewriter rewritingvisitor visitoutput planrewriter java 256 at com facebook presto sql planner plan planrewriter rewritingvisitor visitoutput planrewriter java 65 at com facebook presto sql planner plan outputnode accept outputnode java 78 at com facebook presto sql planner plan planrewriter rewrite planrewriter java 42 at com facebook presto sql planner plan planrewriter rewritewith planrewriter java 31 at com facebook presto sql planner optimization indexjoinoptimizer optimize indexjoinoptimizer java 81 at com facebook presto sql planner logicalplanner plan logicalplanner java 81 at com facebook presto sql analyzer queryexplainer getlogicalplan queryexplainer java 98 at com facebook presto sql analyzer queryexplainer getplan queryexplainer java 60 at com facebook presto sql analyzer statementanalyzer getqueryplan statementanalyzer java 474 at com facebook presto sql analyzer statementanalyzer visitexplain statementanalyzer java 443 at com facebook presto sql analyzer statementanalyzer visitexplain statementanalyzer java 98 at com facebook presto sql tree explain accept explain java 53 at com facebook presto sql tree astvisitor process astvisitor java 24 at com facebook presto sql analyzer analyzer analyze analyzer java 52 at com facebook presto execution sqlqueryexecution doanalyzequery sqlqueryexecution java 199 at com facebook presto execution sqlqueryexecution analyzequery sqlqueryexecution java 184 at com facebook presto execution sqlqueryexecution start sqlqueryexecution java 145 at com facebook presto execution sqlquerymanager querystarter run sqlquerymanager java 397 at java util concurrent executors runnableadapter call executor java 471 at java util concurrent futuretask run futuretask java 262 at java util concurrent threadpoolexecutor runworker threadpoolexecutor java 1145 at java util concurrent threadpoolexecutor worker run threadpoolexecutor java 615 at java lang thread run thread java 744 |
prestodbpresto | incorrect behavior for chain union | Bug | all follow by distinct return too many row postgresql dphillip value 2 union all value 2 union distinct value 2 column1 2 1 row presto presto di value 2 union all value 2 union distinct value 2 col0 2 2 2 3 row distinct follow by all return too few row postgresql dphillip value 2 union distinct value 2 union all value 2 column1 2 2 2 row presto presto di value 2 union distinct value 2 union all value 2 col0 2 1 row |
prestodbpresto | like stop process at first line break in the value | Bug | the current like implementation stop process at the first line break in the value while we be work on a fix for this you can use regexp like regexp like to work around this issue |
prestodbpresto | group by not consistent with be distinct from for nan | Bug | in 0 73 presto select nan be distinct from nan col0 true presto datascience select distinct a a from value 0 0 0 0 x a col0 nan nan but in master 0 74 presto select nan be distinct from nan col0 true presto select distinct a a from value 0 0 0 0 x a col0 nan the behavior in 0 74 be inconsistent nan should not group together if they be distinct from each other we should actually change the behavior to make nan work like null nan nan false nan be not distinct from nan true |
prestodbpresto | timestamp partition not support for hive | Bug | unsupported partition type timestamp for partition date time trunc hour 2013 12 01 00 253a00 253a00 |
prestodbpresto | remote page be too large exception | Bug | the remote page be too large should only happen if a single presto row be massive the output buffer should split page as necessary to fit into the response buffer or the engine should assure that a page never exceed the client buffer size |
prestodbpresto | single distinct aggregation plan be not optimal | Enhancement | these two query be equivalent but second plan be much more efficient since it filter out the non distinct row in the leaf stage presto sf1 explain select count distinct orderstatus from order output col0 col0 count aggregate count bigint count count distinct orderstatus mask orderstatus distinct markdistinct distinct orderstatus varchar marker orderstatus distinct orderstatus varchar orderstatus distinct boolean tablescan tpch tpch order sf1 0 original constraint true orderstatus varchar orderstatus tpch tpch orderstatus 2 presto sf1 explain select count from select orderstatus from order group by orderstatus t output col0 col0 count aggregate count bigint count count aggregate orderstatus orderstatus varchar tablescan tpch tpch order sf1 0 original constraint true orderstatus varchar orderstatus tpch tpch orderstatus 2 |
prestodbpresto | mislead error message for table without column | Enhancement | presto default describe twitter delete column type null partition key 0 row query 20140630 185846 00000 ca9r5 finish 1 node split 2 total 2 do 100 00 0 01 0 row 0b 0 rows s 0b s presto default select count 1 from twitter delete col0 1716 1 row query 20140630 185855 00001 ca9r5 finish 1 node split 2 total 1 do 50 00 0 01 0 row 0b 0 rows s 0b s presto default select from twitter delete query 20140630 185904 00002 ca9r5 fail select not allow in query without from clause the query have a from clause it have no column though the error message should state that |
prestodbpresto | presto very slow when plan on a hive table with a large number of column | Bug | the presto planner currently ask for table column one at a time from a connector the hive connector build up the entire set of column before return a single one effectively make it a o n 2 operation when list all the column this become a problem when you have a very large number of column we notice this on a table with 30 000 column here be a stack trace of where the coordinator be spend the bulk of its time query 20140628 033320 01975 xqtpx 185976 prio 10 tid 0x00007f4eeaee4000 nid 0x2e0c runnable 0x00007f4f39f57000 java lang thread state runnable at org apache hadoop hive serde2 lazy lazyfactory createlazyobject lazyfactory java 165 at org apache hadoop hive serde2 columnar columnarstruct createlazyobjectbase columnarstruct java 78 at org apache hadoop hive serde2 columnar columnarstructbase columnarstructbase java 135 at org apache hadoop hive serde2 columnar columnarstruct columnarstruct java 56 at org apache hadoop hive serde2 columnar columnarserde initialize columnarserde java 102 at com facebook presto hive hiveutil initializedeserializer hiveutil java 214 at com facebook presto hive hiveutil getdeserializer hiveutil java 181 at com facebook presto hive hiveutil gettableobjectinspector hiveutil java 154 at com facebook presto hive hiveutil gettablestructfields hiveutil java 171 at com facebook presto hive hiveclient getcolumnhandle hiveclient java 369 at com facebook presto hive hiveclient getcolumnhandle hiveclient java 353 at com facebook presto hive hiveclient getcolumnhandle hiveclient java 319 at com facebook presto hive prismclient getcolumnhandle prismclient java 409 at com facebook presto spi classloader classloadersafeconnectormetadata getcolumnhandle classloadersafeconnectormetadata java 80 at com facebook presto metadata metadatamanager getcolumnhandle metadatamanager java 266 at com facebook presto sql analyzer tupleanalyzer visittable tupleanalyzer java 202 at com facebook presto sql analyzer tupleanalyzer visittable tupleanalyzer java 115 at com facebook presto sql tree table accept table java 36 at com facebook presto sql tree astvisitor process astvisitor java 22 at com facebook presto sql analyzer tupleanalyzer analyzefrom tupleanalyzer java 859 at com facebook presto sql analyzer tupleanalyzer visitqueryspecification tupleanalyzer java 300 at com facebook presto sql analyzer tupleanalyzer visitqueryspecification tupleanalyzer java 115 at com facebook presto sql tree queryspecification accept queryspecification java 99 at com facebook presto sql tree astvisitor process astvisitor java 22 at com facebook presto sql analyzer statementanalyzer visitquery statementanalyzer java 481 at com facebook presto sql analyzer statementanalyzer visitquery statementanalyzer java 96 at com facebook presto sql tree query accept query java 80 at com facebook presto sql tree astvisitor process astvisitor java 22 at com facebook presto sql analyzer analyzer analyze analyzer java 49 at com facebook presto execution sqlqueryexecution doanalyzequery sqlqueryexecution java 195 at com facebook presto execution sqlqueryexecution analyzequery sqlqueryexecution java 180 at com facebook presto execution sqlqueryexecution start sqlqueryexecution java 141 at com facebook presto execution sqlquerymanager querystarter run sqlquerymanager java 391 at java util concurrent executors runnableadapter call executor java 471 at java util concurrent futuretask run futuretask java 262 at java util concurrent threadpoolexecutor runworker threadpoolexecutor java 1145 at java util concurrent threadpoolexecutor worker run threadpoolexecutor java 615 at java lang thread run thread java 744 |
prestodbpresto | remove dual connector and table | Enhancement | we now support from less query and table expression value dual be no long need |
prestodbpresto | in subquery do not add implicit coercion | Bug | this query should return work but throw an error due to the miss implicit coercion select 1 0 in value 1 2 3 |
prestodbpresto | jdbc client thread prevent jvm shutdown | Bug | there be at least a couple of lame work around the easy way be to terminate the jvm at the end of main thread system exit 0 another option be to de register the driver and then force a garbage collection which should invoke the finalizer simply call close do not work because there be actually two instance of the driver one from registerdriver and the other from serviceloader driver driver drivermanager getdriver jdbc presto drivermanager deregisterdriver driver system gc of course we need to fix this properly in the driver |
prestodbpresto | don t schedule task in the coordinator | Enhancement | currently task for non leaf stage can get schedule in the coordinator this can result in resource starvation for the scheduler and other maintenance task we should disable this behavior or at least make it configurable |
prestodbpresto | identity cast of hyperloglog fail | Bug | select cast cast null as hyperloglog as hyperloglog result in query 20140422 220951 00004 n5kdf fail can not cast com facebook presto spi type hyperloglogtype 74bebc01 to com facebook presto spi type hyperloglogtype 74bebc01 com facebook presto sql analyzer semanticexception can not cast com facebook presto spi type hyperloglogtype 74bebc01 to com facebook presto spi type hyperloglogtype 74bebc01 at com facebook presto sql analyzer expressionanalyzer visitor visitcast expressionanalyzer java 570 at com facebook presto sql analyzer expressionanalyzer visitor visitcast expressionanalyzer java 169 at com facebook presto sql tree cast accept cast java 46 at com facebook presto sql analyzer expressionanalyzer analyze expressionanalyzer java 166 at com facebook presto sql analyzer expressionanalyzer analyzeexpression expressionanalyzer java 813 at com facebook presto sql analyzer tupleanalyzer analyzeselect tupleanalyzer java 781 at com facebook presto sql analyzer tupleanalyzer visitqueryspecification tupleanalyzer java 281 at com facebook presto sql analyzer tupleanalyzer visitqueryspecification tupleanalyzer java 106 at com facebook presto sql tree queryspecification accept queryspecification java 99 at com facebook presto sql tree astvisitor process astvisitor java 22 at com facebook presto sql analyzer statementanalyzer visitquery statementanalyzer java 457 at com facebook presto sql analyzer statementanalyzer visitquery statementanalyzer java 91 at com facebook presto sql tree query accept query java 80 at com facebook presto sql tree astvisitor process astvisitor java 22 at com facebook presto sql analyzer analyzer analyze analyzer java 49 at com facebook presto execution sqlqueryexecution doanalyzequery sqlqueryexecution java 199 at com facebook presto execution sqlqueryexecution analyzequery sqlqueryexecution java 184 at com facebook presto execution sqlqueryexecution start sqlqueryexecution java 145 at com facebook presto execution sqlquerymanager querystarter run sqlquerymanager java 391 at java util concurrent executors runnableadapter call executor java 471 at java util concurrent futuretask sync innerrun futuretask java 334 at java util concurrent futuretask run futuretask java 166 at java util concurrent threadpoolexecutor runworker threadpoolexecutor java 1145 at java util concurrent threadpoolexecutor worker run threadpoolexecutor java 615 at java lang thread run thread java 722 |
prestodbpresto | task stuck in plan state | Bug | there s some weird bug in the coordinator that result in query get stick the symptom be one or more task for a query in state planning other task get split assign and make progress worker associate with that task doesn t receive any http request for status update or split assignment for the task restart the worker doesn t seem to fix the issue restart the coordinator fix it |
prestodbpresto | push down limit clause to connector source level | Enhancement | so connector can use the limit clause to limit the result |
prestodbpresto | default read timeout for httpclient too large | Bug | the default read timeout for httpclient be 1minutes most remote interaction in presto be short and automatically retire so a long timeout be counterproductive a short timeout will allow presto to detect fail query much fast and free up resource |
prestodbpresto | bad connector can hang worker | Bug | if a connector hang in a call to recordset all thread in the worker can become deadlocke taskexecutorthread prioritizedsplitrunner process driversplitrunner processfor driver process hang due to bug in connector callbackthread statemachine transition to a do state taskexecutor removetask driversplitrunner close deadlock driver close next call so we would deadlock here also allhttpworkerthread taskresource createorupdatetask sqltaskmanager updatetask taskexecutor addtask |
prestodbpresto | add an info only http query endpoint | Enhancement | presto currently combine the ability to fetch query progress info with the fetching of the result presto should add another http end point that allow fetch of query progress info but without return datum and without count as a heartbeat |
android10androidcleanarchitecture | should repository know about authenticated user | Question | in my project I need to fetch some datum relate to the authenticated user and for that I need the userid of the user I have an authmanager class that give I the userid of the authenticated user I be confused whether to add this authmanager class as a member of my userrepository implementation or just get the userid from authmanager outside the repository and provide it when need basically I have 2 option option 1 add authmanager as a member to the userrepository implementation userrepository will contain function like getauthenticateduserfirstname getauthenticateduserlastname etc in the implementation of these function use the authmanager to get the necessary userid internally option 2 leave out authmanager from the repository userrepository will contain function like getfirstname string userid getlastname string userid etc when call these function use the authmanager to get the require userid parameter look for feedback and suggestion |
android10androidcleanarchitecture | why transform user in the user to usermodel in the presentation | Question | hello everyone why we be transform the user class to usermodel we could pass just the user instance afterall to the view why add this complexity thank you |
android10androidcleanarchitecture | q handle network response during screen rotation | Question | hi I would like to get your input on how to handle network response during screen orientation change the scenario as follow 1 network request initiate after setview be call in a fragment s onviewcreate method 2 user rotate the device ondestroy get call which in turn would nullify view interface in presenter class 3 before oncreatedview method be call again response arrive from the network request in this state the view interface on presenter would be null and the response be lose thank you |
android10androidcleanarchitecture | uml package diagram for cleanarchitecture | Question | android10 hi I come to the concept of clean architecture it be really inspire I have read all your 4 article include the last one for dynamic parameter I think you be do gr8 work here I really admire your sharing attitude with other in the path to understand the code especially I m not android guru just want to get my hand dirty in android field I have use draw io to draw uml package diagram for the 3 layer as below I m an old guy that be use to uml more in the design field if you like the idea I can draw several uml diagram include class sequence share it with you if you can correct I maybe u be generous enough to write a 5th post to describe the code assist with diagram it will be great clean architecture layer again thank for yr gr8 effort and keep up the good work |
android10androidcleanarchitecture | how to deal with complicated view | Question | one view can only hold single presenter single usecase can only do single thing but when the view or the business logic be too complicated its presenter must hold many usecase when the logic between multiple usecase be very complicated the code of presenter must be hard to maintain I want to reuse multiple usecase in multiple view without single presenter so what should I do create combine usecase in domainlayer maybe not do single thing or use multiple usecase in presenter still and I wonder where the result datum of single usecase should be place the datum use by other usecase later or the status datum the presenter |
android10androidcleanarchitecture | what about offline first live local datastore update | Question | hi all alright in my project I follow an offline first architecture where I m always query the local datastore for each ressource that require query a presenter have two usecase object 1 one that make request to the remote data store and save it locally it never deliver information to presenter the rx subscriber only do log all save operation be perform in doonnext 2 another one that be directly subscribe to the local datastore and listen for insertion deletion update via an observable so that once something be change it query datum and present it to the view java final fetcharticlecollectionusecase mfetcharticlecollectionusecase final getarticleupdatesusecase mgetarticleupdatesusecase it s work pretty well now but I m wonder if I m still make a good use of usecase and I personally find it cumbersome to write two usecase for one datum output every time |
android10androidcleanarchitecture | how to use multiple usecase in single view or single presenter | Question | I think the view can only exist single presenter I see the presenter in demo only need one usecase but the usecase only do single thing so how to do this use multiple presenter in view or user multiple usecase in presenter |
android10androidcleanarchitecture | what about global error handle | Question | in the project error handling be show error message in presentation layer but if we need add exception notauthorizedexception in datum layer and handle all error from restapi with 401 code error in presentation layer we need handle this error and show authactivity override public void onerror throwable e userdetailspresenter this hideviewloading if e instanceof notauthorizedexception userdetailspresenter this showauthscreen else userdetailspresenter this showerrormessage new defaulterrorbundle exception e userdetailspresenter this showviewretry can we have a global error handler for each presenter preferably for the entire application at once for certain type of error thus we do not have to duplicate code in each subscriber furthermore we can have a default subscriber perhaps this approach be a bit contrary to rxjava philosophy but in this case it seem to I it be justify any idea on this domain public interface restapierrorhandle void handle throwable throwable public abstract class usecase private restapierrorhandling restapierrorhandle publlic void registererrorhandling restapierrorhandling restapierrorhandle this restapierrorhandle restapierrorhandle protect abstract observable buildusecaseobservable public void execute subscriber usecasesubscriber this subscription this buildusecaseobservable doonerror throwable if restapierrorhandle null restapierrorhandle handle throwable subscribeon scheduler from threadexecutor observeon postexecutionthread getscheduler subscribe usecasesubscriber presentation public class userdetailspresenter implement restapierrorhandle private final usecase getuserdetailsusecase private final usecase shareuserusecase private final usecase addtofavoriteuserusecase public class userdetailspresenter name getuserdetailsusecase usecase getuserdetailsusecase name shareuserusecase usecase shareuserusecase name addtofavoriteuserusecase usecase addtofavoriteuserusecase this getuserdetailsusecase getuserdetailsusecase this shareuserusecase shareuserusecase this addtofavoriteuserusecase addtofavoriteuserusecase getuserdetailsusecase registererrorhandle this shareuserusecase registererrorhandle this addtofavoriteuserusecase registererrorhandle this private void getuserdetail this getuserdetailsusecase execute new userdetailssubscriber public void shareuser this shareuserusecase execute new defaultsubscriber public void addtofavoriteuser this addtofavoriteuserusecase execute new defaultsubscriber override public void handle throwable throwable if throwable instanceof notauthorizedexception this viewdetailsview showauthscreen p s what about the eventbus error handler in the datum layer can sent error via the eventbus error to the presentation layer for example if an application be build on the one activity it be possible to transmit an error on the main presenter and show auth screen it will be correct |
android10androidcleanarchitecture | model for list view item and detail view | Question | I m fetch some datum from 3rd party library to access their api for example I create two use case fetchuserlist and fetchuserdetail to fetch user list and user detail the user list will be display in recycler view but only the user name part and in user detail view user name and company name will be display the model receive from the server api model as in the library as follow class user string name int companyid class company int i d string companyname what model should I create in my domain layer should I create two model one for the fetch user list use case and another one for fetch detail use case seem the result model will be dictate by the view in recycler view I don t need company name exclude unnecessary datum but in the detail view I need to display more datum I m think something like below but in the user list view case I do not need the company datum class usermodel string name company company what would you suggest thank you |
android10androidcleanarchitecture | do the usage of android datum bind librarary correspond to the clean architecture principle | Question | be it good to use this library in term of clean architecture |
android10androidcleanarchitecture | where be the good place to call subscribeon and observeon method | Question | I wonder where be the good place to call subscribeon and observeon method what module s should handle all thread relate activity |
android10androidcleanarchitecture | library dependency across layer | Question | I have a library module that I be reuse across multiple application the library be compose of two module one android library module that depend on a java library module that contain my domain logic then in the project that I depend on this library I have split into the three module use in the android cleanarchitecture application my question be how do I use object from the domain module from my android library in the main project s domain module at the moment I would have to convert the main project s domain module to an android library module at the moment in the android cleanarchitecture application it doesn t really use any reusable module so I couldn t see how this would be do |
android10androidcleanarchitecture | what about thing like appsetting | Question | good day I have some difficulty with stuff like isauthorize isfirststart etc in particular isauthorize be a flag indicate that the user have be log in which solution will be well 1 should we write an interactor and access appsettingsrepository 2 or simply consider appsetting as a kind of ui set which live in presentation layer therefore we can define for example an appsetting interface and inject in particular appsettingsimpl wrapper model build use sharedpreference which can be access even in ui thread thank in advance |
android10androidcleanarchitecture | save with rxjava and the repository pattern | Question | hi I have be read the other issue and they all seem to be relate to datum retrieval rather than save datum both usecase s in the project be for retrieval also my question be what should I return if anything upon save an entity and should this be an observable at the moment follow the whole separation of concern and mapping entity at boundary we get usermodel user userentity save in repo return save entity userentity user usermodel be this correct or be there a different pattern I should be follow for insert and update operation |
android10androidcleanarchitecture | how to deal with login | Question | introduction at the datum layer I have retrofit interface for example public interface someapi post observable login loginrequest body at the domain layer I have accountmanger public class accountmanager private someapi api inject public accountmanager someapi api errot someapi out of classpath this api api public void login string login string password subscriber subscriber api login and then I would use accountmanager in presentation layer but nope compile time error someapi be in datum module classpath because domain module have no gradle dependency on datum module as data module have android dependency while domain module hasn t there be my solution create loginapi interface public interface loginapi observable login loginrequest body use it in accountmanager public class accountmanager private loginapi api inject public accountmanager loginapi api this api api create implementation of loginapi on datum layer that use someapi public class loginapiimpl implement loginapi private someapi api inject public loginapiimpl someapi api this api api observable login loginrequest body return api login body and inject it via dagger 2 in presentation layer any other idea |
android10androidcleanarchitecture | question prepare datum for presentation layer | Question | hi I be try to adopt idea from clean architecture to my app and have follow question in my view I have to show a summary of datum calculate from different entity I do not know where to do the calculation stuff 1 calculate in datum layer so domain will only pass through to presenatation layer so what s the benefit of domain layer 2 get datum entity from datum layer and calculate in domain layer and pass then to presentation layer how to take benfit here from sql and retrieve a summary in a performant way 3 get datum entity from datum and domain and pass to presentation layer and do the calculation there every new presentation view have to do this job be there other option be there a good practice for such a usecase thank for any advice |
android10androidcleanarchitecture | what about communicate between presenter | Question | I need show progressbar in parent fragment in case if child fragment have need state for example count element in listview to solve the problem it be necessary that the presenter be able to communicate the mainpresenter should know about entity size in the childpresenter be it correct from the point of view mvp if the presenter will know about another presenter and how this approach can be implement in clean architecture java main public interface mainview void showloade public class mainfragment implement mainview childfragment childfragment private void init childfragment new childfragment view add childfragment public void showloading show progressbar public class mainpesenter public void showloading getview showloade show only if childpresenter have count 0 child public interface childview void showlist list entity public class childfragment implement childview public void showlist list entity show list on ui public class childpresenter list entity public void init entity getentitie getview showlist entity public int getcount return entity size |
android10androidcleanarchitecture | layer for manager and service that require android context | Question | hi I be try to migrate to clean architecture I have application which be make in standard way I try to decouple but still a lot of stuff happen in activity and fragment example be quite simple mostly application be much more complex so it be much hard to decouple all highly couple component inside application I have just face with one problem be manager and service that require applicationcontext or activitycontext for example I have locationmanager which be responsible for get location but it require context at least to get service and to listen to lifecycle of activity I think this manager could go to data layer but this be undesirable dependency I really don t want to put this login into presentation layer I firmly believe that presentation layer should be just ui and only ui nothing more unfortunately android sdk be build in a way that we have god object activity but I still wanna to get rid of anything except use case in presentation layer I see some way how this can be solve 1 add new layer or sublayer which will be responsible for handle all context relate stuff and call it for example service or lifecycle layer and make it tight to context lifecycle also in order to keep thing abstract interface with common lifecycle method can be create oncreate ondestroy and inject via dependency injection tool like our beloved dagger 2 2 without separate layer there be only one way be to add android dependency to some layer presentation layer be already couple to android context but again ui should be ui nothing more consume update and request datum through use case from domain layer furthermore one important thing to note that locationmanager be great example of publisher subscriber pattern so it can be easily adopt to rxjava all thing consider I would be grateful for any thought advice on this problem |
android10androidcleanarchitecture | datum layer know about domain layer | Question | hi everyone I wild about clean architecture design pattern I feel a long time ago that I need to design application in another way find awesome article about clean architecture but have just start to implement it I have one question about datum and domain layer as I understand 1 datum layer be responsible for get datum from different place like file db cloud 2 domain be responsible for use case use case be verb use in application like getuserwithawesomeavatarimage or something else this layer be responsible for create specific request to datum layer datum layer support crud operation only all application specific logic should be handle on domain layer there be also one important rule that dependency arrow should only point from upper layer to low but not vice versa but in example provide by author there dependency pointing from datum to domain maybe I be wrong but I think that it should point from domain layer to datum for example create all repository stuff on datum layer but domain layer will just consume repository from datum layer for example use dependency injection please explain this |
android10androidcleanarchitecture | how to submit a form | Question | public final class feeddraftaddusecase extend usecase private final feeddraft mfeeddraft private final feeddraftrepository mfeeddraftrepository inject public feeddraftaddusecase feeddraft feeddraft feeddraftrepository feeddraftrepository threadexecutor threadexecutor postexecutionthread postexecutionthread super threadexecutor postexecutionthread this mfeeddraft feeddraft this mfeeddraftrepository feeddraftrepository override protect observable buildusecaseobservable return mfeeddraftrepository insertfeeddraft mfeeddraft this mfeeddraft how to ject |
android10androidcleanarchitecture | fragmentmanager | Question | I have an activity with lot of fragment which be replace in one container I have an own navigationmanager class which handle the fragment and do the replacement and other thing with the fragment where be the good place to instantiate and manage the navigationmanager view or presenter |
android10androidcleanarchitecture | why the domain layer be tigthly couple to a framework dependency rxjava | Question | hi here I be again this time with a different concern cite uncle bob s explanation of use case we also do not expect this layer use case to be affect by change to externality such as the database the ui or any of the common framework this layer be isolate from such concern your use case depend on rxjava framework I have to provide a subscriber implementation in order to obtain list or a single user I expect that a usecase hide the implementation logic from the outside to I a usecase be give an i d return a user your case be give an i d and a subscriber implementation return a user what if at some point I don t want to use rxjava anymore my usecase shouldn t change I have an i d and I want a user back but it still require something depend on an external framework mean that I have to reimplement my usecase even though nothing have change except for the framework it use to accomplish the job thank you android10 |
android10androidcleanarchitecture | why datum layer have a dependency on the domain layer | Question | as state in clean architecture dependency should point only inward this separate layer in a way that they could be interchangeable easily and also decouple right in your case you decide to create 3 layer which have this dependency relationship presentation domain datum you use di for some good reason still decouple dependency inversion ecc however from your build gradle file it seem that datum have a dependency on domain while domain doesn t have anything the dependency be in this way presentation domain datum could you explain I why be there something I m miss |
android10androidcleanarchitecture | mvp with custom view | Question | hi all this be not an issue but a topic of discussion what do you think about custom view be mvp still applicable for example let s say that you have a fragment that contain a couple of custom view one way be to consider the fragment as the mvp view with its own presenter the fragment view would ask from the presenter to load datum for each view and then the presenter will call the appropriate fragment view method then the fragment will call custom view method to set their datum another solution be to make each custom view a full mvp view view interface presenter etc so each custom view will ask the presenter for datum etc in case the custom view have the need to communicate with each other we could use the fragment as a controller which be register as a listener to the custom view callback interface the fragment will be notify of a custom view event and will ask from another custom view to reload its datum base on that event the other custom view will use the full mvp cycle of course what be your opinion thank |
android10androidcleanarchitecture | why there be no activity context injection | Question | I don t know this be a bug or just my misunderstanding java inject public usersadapter context context this layoutinflat layoutinflat context getsystemservice context layout inflater service this userscollection collection emptylist here you have inject an adapter this adapter have a context type parameter apparently this should be an activity context because application context lack the app theme and so on but there be no activity context provide in your di only application context have be provide java provide singleton context provideapplicationcontext return this application and I find an activity dependancy provide in activitymodule java provide peractivity activity activity return this activity my question be do you replace activity context with application context or with an acitivity cast by di automatically or this be just a bug |
android10androidcleanarchitecture | framework integration | Question | hi can you share your thought where should framework specific stuff be place for example I have to integrate follow gcm push notification regular push notification with news google analytic track for pageview s and event where should gcm code reside instanceidlistenerservice and gcmlistenerservice how would you handle processing of incoming notification payload where would you place track relate class and should we call tracker from presenter or usecase |
android10androidcleanarchitecture | question about what the view must do | Question | I have be study this project for a while now and I have a few question that be not so clear to I 1 in this project the verification for internet connection be make in the datum layer but this seem not to be the good thing to do because you need to have android framework code in this layer to I the only layer that must have framework specific code be the view layer or I m miss something put the connection verification in this layer be a problem 2 if the view have some button but these button only do simple thing like start another activity or fire a share intent I need to pass these event to presenter and then bring back to the view or the view itself could react to they 3 suppose the fragment activity need to take a screenshot of some view in the screen e g an item in the recyclerview and save this screenshot in gallery for I the right way to do that be to do this in background because that way we don t block the ui but follow this project principle I will need a use case to that and so I will need to pass the view the view that I need to take the screenshot down in the layer this use case will have a lot of framework specific code e g generate bitmap from view save in gallery and this do not seem right my solution for this specific case be to create a simple observable in the fragment activity and do that job right there but this way the view layer now have some kind of logic be this a problem what be the good way to do that thank |
android10androidcleanarchitecture | why do we have entity in datum layer and not in domain layer | Question | it s just name convention but I think accord to the clean architecture circle diagram it would be more clear if the object define enterprise business rule in the domain layer would be call entity be I right |
android10androidcleanarchitecture | how about realm | Question | I be just wonder to know your thought about the good way to implement realm entity realm need the android framework so I can not have realm object in the domain layer so I m think to create other realm entity in the datum layer and then map domain object to realm object do it make sense also the repository interface must return observable realm entity because I could retrieve datum from the realm database if the cache be not expire can I move the repository interface to the datum layer thank |
android10androidcleanarchitecture | compose use case observable | Question | hi guy great project at my company we have base an app on this template and the principle in the accompany blog post for some more advanced feature in the app we run into an issue that be very similar to another one mention by amatkivskiy we would like to be able to compose and combine use case together to form new use case as mention rxjava provide a huge toolbox of operator for compose observable which would be perfect however the use case interface in this project accept subscriber and doesn t expose observable directly this make it awkward to compose and combine use case with rxjava operator the approach I go with be first to use subject to adapt the subscriber interface into an observable then to create a new custom observable this work but isn t great as there s a lot of nest and boilerplate I be wonder what the reasoning behind the design choice of have use case accept subscriber rather than return observable be be it so that use case hide the knowledge of which scheduler be use to subscribe on observe on what would be the downside of have use case return a single observable I m still new to use rx in an android app architecture so I m keen to hear some discussion around this and learn something thank again for contribute this to the community |
android10androidcleanarchitecture | organize by feature view injection | Question | in your blog you mention that organize the code via feature be well and I totally agree in my case I ve split my app into different module and each module be actually a feature I assume that this be how you guy also work at soundcloud so as to allow individual team work on a feature to work independently on split the code by module I m not able to use butterknife s bind annotation since android doesn t mark r constant in module as static final hence I get a compile time for the follow bind r i d auth et password edittext passwordtxt error receive error 44 15 error element value must be a constant expression so how do you guy inject view do you have a custom framework or use androidannotation framework or something else or you don t split by module disclaimer I m a android noob |
android10androidcleanarchitecture | how to load domain entity | Question | hi and thank you for your blog and example they be very helpful I m currently learn clean architecture and I be think about domain entity and how to load they correctly let s say I want to display a list of tv show from a database the tvshow class will have a name a synopsis and a list of episode each episode have a name a length and so on in my database I can use identifier to refer other table but field in the domain model should be the correct class e g list how should I load this object graph I win t create all dependency because I will end up load everything from my database but in the same time my object may have business method that need some of they I think about lazy loading but the domain layer be framework independent so that s not an option last idea be not to load they but then the object may be inconsistent what be the right approach to this problem |
android10androidcleanarchitecture | interface in the view package | Question | in the presentation layer the interface from view package userdetailsview userlistview shouldn t be in the presenter package if I understand the dependency inversion principle the presenter should define the interface that the view have to implement |
android10androidcleanarchitecture | what would play music file look like in clean architecture | Question | hi it be not actual issue just question I be very interested in clean architecture and my application be about play audio file I be about to rewrite my app for the third time none even complete in 20 this time use clean architecture how would play music file fit in ca where should music play service reside which layer |
android10androidcleanarchitecture | refactor project structure to one single module | Help Wanted | hi guy as you can see I have be work on a single module project structure here be the pr I m not say that I will land it but I do want to start a discussion around it and see pro and con for either a single module project or multi module project the first couple of thing that come to my mind advantage scalability package organization into feature so work with a feature team model will fit well specially when the number of contributor to the codebase be big scope favor exposure to only necessary member remove many public method from feature specific class build system less overhead since build logic sit on only one project and we do not have to maintain many build gradle file for each project well performance drawback clarity by have 3 module each layer responsibility be very clear dependency with the framework by have only one android module we be expose to make mistake and break both dependency rule and dependency on android java framework a few extra eye be very appreciated so let s try to find the good way to keep on improve this codebase spirosoik trikke caseykulm I mention you guy since have be collaborate a lot thank feel free to involve anyone here smiley |
android10androidcleanarchitecture | too many step to invoke navigator method be not it | Question | could someone explain I why navigator s method be call from activity not from fragment directly why first we invoke presenter s method which in turn invoke fragment s method which invoke activity s method |
android10androidcleanarchitecture | why doesn t the current applicationmodule have providenavigator | Question | in your post here I see the follow method in applicationmodule class but the actual github code doesn t have this method but what be weird be this run even without it can you explain how so thank provide singleton navigator providenavigator return new navigator |
android10androidcleanarchitecture | how to make an alarm follow the principle of clean architecture | Question | hi I have a question if I have to implement something like alarm that will trigger at specific time and run my use case set an alarm be business logic of my app so it should be locate in domain direct I if I wrong and it s use case should set up my alarm so it should have the android class at this moment I have domain module like android library and one use case set up an alarm that start a broadcast ideally that broadcast should run the same use case and set up another alarm I would like to know a valid approach how to do that logic implement 1 user add cycle transaction and add set alarm addcycleoperationusecase write to db implement 2 addcycleoperationusecase set the alarmmanager with intent with cycleoperation model want triggering broadcast that ideally have inject addcycleoperationusecase and it will do same operation again p s I see few example of ca by uncle bob and it seem domain module it s something like a wrapper that encapsulate crud it isn t |
android10androidcleanarchitecture | query criterion for repository | Question | hi guy I have query with three param and I want to make this triplette a criterion object where do you think be the good place to add the criterion object in order to not violate the rule of clean architecture currently I add in the domain layer any other suggestion or well approach basically I want to have these param as a pod |
android10androidcleanarchitecture | multiple component provide by activity | Question | the current implementation allow an activity to provide a component to any subclass implement hascomponent interface for instance userlistfragment java java private void initialize this getcomponent usercomponent class inject this this userlistpresenter setview this but what about further fragment inside the same activity imagine I want to add some otherfragment java later in the same activity which need some othercomponent as the activity can implement hascomponent for only one type it can not provide othercomponent to the new fragment I m new to android clean architecture and maybe I m miss something maybe this be not the propper way to achieve what I want any advice thank |
android10androidcleanarchitecture | usecase responsibility | Question | what can subclass of usecase do what can t they do in this project use case be atomic task use to simply obtain datum but what about decision make where do that belong example 1 I have a collection of item and lazy loading be there one usecase handle all pagination logic and call necessary repository method or be there multiple usecase and something presenter orchestrate they example 2 after execute a usecase base on its response we make a decision on what usecase to call next again where be this decision make |
android10androidcleanarchitecture | external service bind use case | Question | hi guy I m try to implement the clean architecture into a big android enterprise project since it fit perfectly in our need the only obscure thing it s about bind unbind to external service which expose an api trough aidl my question be where the bind unbind call go our external service act like a repository method call callback with result but it could push some datum to the app occasionally callback only so in the use case where we pull datum from service this could fit into the datum layer about the second use case when the service need to push datum this go in the datum layer as well since some obeservable could notify about the change to the service datum we use a memory cache which once update notify about the new state in any way for both to work this way we need to bind to the external service interface it s right to write use case to handle this scenario like un registerfordataupdate |
android10androidcleanarchitecture | where be the good place to validate the datum | Question | in order to load the model in a view I have to check the datum for some precondition for example for some string color value ffffff which be come from backend we have to check it if its not null then parse it with color parsecolor where be the good place to put such code like this be it a good idea if I define the presentation layer model s backgroundcolor propery as int and perform check transformation from string domain layer object to color int presentation layer in the model datum mapper in the presentation layer domain layer object private string mbackgroundcolor tranformation presentation layer model private int mbackgroundcolor or maybe validation code have to be a part of the buisiness logic but for transformation in the presnetation layer from string to int I just call trust color parsecolor |
android10androidcleanarchitecture | need to be able to initialize injector in fragment | Question | specifically when fragment be be use in a viewpager |
android10androidcleanarchitecture | pass an object from the presentation layer domain layer datum layer | Question | hi android10 I have a couple of question regard how to pass an object from the presentation layer to the domain layer and then to the datum layer I have a use case when a user sign up within my app 1 pass and object from the domain layer to the datum layer this be the interface in the domain layer between the domain and the datum layer java public interface userrepository the user class belong to the domain layer observable signup user user and this be the usecase subclass java public class signupusecase extend usecase member set up in the signupusecase constructor private user user private userrepository userrepository override protect observable buildusecaseobservable return userrepository signup user now in the datum layer the implementation of the userrepository interface of the domain layer be define as follow java public class userdatarepository implement userrepository private final userentitydatamapper userentitydatamapper public observable signup user user final userdatastore userdatastore userdatastorefactory createclouddatastore declare variable to make this code easy to read userentity transformeduserentity userentitydatamapper transform user return userdatastore signup transformeduserentity map userentity this userentitydatamapper transform userentity this take I to define 2 method in the userentitydatamapper class as follow java public user transform userentity userentity public userentity transform user user be this a correct implementation on how to pass object from the domain to the datum layer 2 pass and object from the presentation layer to the domain layer for the signupusecase use case I need a user define in the domain layer to be supply via it s constructor in the usermodule java module public class usermodule the usermodel class belong to the presentation layer private usermodel usermodel provide peractivity name signup usecase providesignupusecase userrepository userrepository threadexecutor threadexecutor postexecutionthread postexecutionthread return new signupusecase usermodel userrepository threadexecutor postexecutionthread but then I d need a user mapper to transform a usermodel define in the presentation layer to a user define in the domain layer where should I place this user mapper in the usermodule or in the signupusecase class |
android10androidcleanarchitecture | errormessagefactory clean approach | Question | I be wonder if this can be do in an efficient way than the current one because if you have many type of exception then this will be a huge if else if to catch all the case I suppose that one solution be to separate the factory per feature but still I will duplicate the same code for application error or no internet connection to every factory |
android10androidcleanarchitecture | push event in the datum layer to the presentation layer | Question | what about update event in the datum layer and how to notify about they the presentation layer let s suppose that some third party service have update some user datum in the data base be event bus approach good for that for example we will define some event class in the domain layer userupdatedevent some presenter in the presentation can subscribe unsubscribe for this event on the event bus datum layer can post the userupdatedevent on event bus |
android10androidcleanarchitecture | userdatarepository break dependecy rule | Question | hi didn t userdatarepository break dependency rule class be from datum layer but implement userrepository interface which be from domain layer thank rohliq |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.