Unclear parse errors when translating complex PSQL query to SparkSQLKibana visualize - show most recent without aggregationEfficiently perform COUNT DISTINCT with spark, on csvs?Impala vs SparkSQL: built-in function translation: fnv_hashInserting into MySQL tables through SparkSQL, by querying from the same tableSparkSQL “CASE WHEN THEN” with two table columns in pysparkSPARK : Data frame Select expression failed to do append operation if both single quote and double quote present in the valueOptimize distinct values on a large number of columnsHow to concurrently insert SparkSQL query output to HIVE while using it for another SparkSQL queryNested query in SparkSQL with a LimitSpark Sql to read from Hive orc partitioned table giving array out of bound exception

What verb goes with "coup"?

How can I get a file's size with C++17?

Why is 一日 used instead of 日 to ask how your day is?

What is the difference between a historical drama and a period drama?

Olive oil in Japanese cooking

Do I need to be legally qualified to install a Hive smart thermostat?

Finding integer database columns that may have their data type changed to reduce size

Why are symbols not written in words?

How long had Bertha Mason been in the attic at the point of the events in Jane Eyre

Which high-degree derivatives play an essential role?

Why is quantum gravity non-renormalizable?

Story about two rival crews terraforming a planet

Did Snape really give Umbridge a fake Veritaserum potion that Harry later pretended to drink?

Should I cross-validate metrics that were not optimised?

Should I cheat if the majority does it?

Are semivowels pronounced differently than vowels?

Why would a propellor have blades of different lengths?

Did Winston Churchill praise Rolls-Royce engines?

Term for a character that only exists to be talked to

Will greasing clutch parts make it softer

Contributing to a candidate as a Foreign National US Resident?

Is there any way for a Half-Orc Sorcerer to get proficiency with a heavy weapon?

Magento 2: I am not aware about magneto optimization. Can you please share the steps for this?

How come having a Deathly Hallow is not a big deal?



Unclear parse errors when translating complex PSQL query to SparkSQL


Kibana visualize - show most recent without aggregationEfficiently perform COUNT DISTINCT with spark, on csvs?Impala vs SparkSQL: built-in function translation: fnv_hashInserting into MySQL tables through SparkSQL, by querying from the same tableSparkSQL “CASE WHEN THEN” with two table columns in pysparkSPARK : Data frame Select expression failed to do append operation if both single quote and double quote present in the valueOptimize distinct values on a large number of columnsHow to concurrently insert SparkSQL query output to HIVE while using it for another SparkSQL queryNested query in SparkSQL with a LimitSpark Sql to read from Hive orc partitioned table giving array out of bound exception






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I have been doing some analysis on the Lumen database and have recently swapped to spark as the csv's are >100GB and too hefty for a single machine.



Most of my queries are running fine, however, the following seems to be having some issues:



psql = "select b.*, "
"(select count(distinct c.notice_sender) from lumen_sender_duplicate_utility c where c.domain_name = b.domain_name and cast(c.num_of_dup_urls as int) = 0 ) num_of_distinct_senders "
"from (select a.domain_name, sum(a.num_of_url) total_num_urls, "
"sum(a.num_of_dup_urls) total_num_dup_urls, count(distinct a.notice_sender) total_num_senders "
"from lumen_sender_duplicate a group by a.domain_name) b"


There have been a variety of errors as I have changed it around, but the most recent is the following: (full stack trace available at https://pastebin.com/raw/Xk4wVDmD)



Caused by: java.lang.RuntimeException: Couldn't find count(DISTINCT notice_sender)#419L in [domain_name#13,sum(cast(num_of_url#14 as double))#415,sum(cast(num_of_dup_urls#16 as double))#416,count(notice_sender#10)#417L]
at scala.sys.package$.error(package.scala:27)



Initially I though this was because some features such as distinct or subqueries were not available, but I am using spark 2.4 and everything seems fine to that end. (I have also tested each of the components separately and there doesn't seem to be an issue). If anyone has an idea of where I am going wrong, any help would be much appreciated.










share|improve this question




























    1















    I have been doing some analysis on the Lumen database and have recently swapped to spark as the csv's are >100GB and too hefty for a single machine.



    Most of my queries are running fine, however, the following seems to be having some issues:



    psql = "select b.*, "
    "(select count(distinct c.notice_sender) from lumen_sender_duplicate_utility c where c.domain_name = b.domain_name and cast(c.num_of_dup_urls as int) = 0 ) num_of_distinct_senders "
    "from (select a.domain_name, sum(a.num_of_url) total_num_urls, "
    "sum(a.num_of_dup_urls) total_num_dup_urls, count(distinct a.notice_sender) total_num_senders "
    "from lumen_sender_duplicate a group by a.domain_name) b"


    There have been a variety of errors as I have changed it around, but the most recent is the following: (full stack trace available at https://pastebin.com/raw/Xk4wVDmD)



    Caused by: java.lang.RuntimeException: Couldn't find count(DISTINCT notice_sender)#419L in [domain_name#13,sum(cast(num_of_url#14 as double))#415,sum(cast(num_of_dup_urls#16 as double))#416,count(notice_sender#10)#417L]
    at scala.sys.package$.error(package.scala:27)



    Initially I though this was because some features such as distinct or subqueries were not available, but I am using spark 2.4 and everything seems fine to that end. (I have also tested each of the components separately and there doesn't seem to be an issue). If anyone has an idea of where I am going wrong, any help would be much appreciated.










    share|improve this question
























      1












      1








      1








      I have been doing some analysis on the Lumen database and have recently swapped to spark as the csv's are >100GB and too hefty for a single machine.



      Most of my queries are running fine, however, the following seems to be having some issues:



      psql = "select b.*, "
      "(select count(distinct c.notice_sender) from lumen_sender_duplicate_utility c where c.domain_name = b.domain_name and cast(c.num_of_dup_urls as int) = 0 ) num_of_distinct_senders "
      "from (select a.domain_name, sum(a.num_of_url) total_num_urls, "
      "sum(a.num_of_dup_urls) total_num_dup_urls, count(distinct a.notice_sender) total_num_senders "
      "from lumen_sender_duplicate a group by a.domain_name) b"


      There have been a variety of errors as I have changed it around, but the most recent is the following: (full stack trace available at https://pastebin.com/raw/Xk4wVDmD)



      Caused by: java.lang.RuntimeException: Couldn't find count(DISTINCT notice_sender)#419L in [domain_name#13,sum(cast(num_of_url#14 as double))#415,sum(cast(num_of_dup_urls#16 as double))#416,count(notice_sender#10)#417L]
      at scala.sys.package$.error(package.scala:27)



      Initially I though this was because some features such as distinct or subqueries were not available, but I am using spark 2.4 and everything seems fine to that end. (I have also tested each of the components separately and there doesn't seem to be an issue). If anyone has an idea of where I am going wrong, any help would be much appreciated.










      share|improve this question














      I have been doing some analysis on the Lumen database and have recently swapped to spark as the csv's are >100GB and too hefty for a single machine.



      Most of my queries are running fine, however, the following seems to be having some issues:



      psql = "select b.*, "
      "(select count(distinct c.notice_sender) from lumen_sender_duplicate_utility c where c.domain_name = b.domain_name and cast(c.num_of_dup_urls as int) = 0 ) num_of_distinct_senders "
      "from (select a.domain_name, sum(a.num_of_url) total_num_urls, "
      "sum(a.num_of_dup_urls) total_num_dup_urls, count(distinct a.notice_sender) total_num_senders "
      "from lumen_sender_duplicate a group by a.domain_name) b"


      There have been a variety of errors as I have changed it around, but the most recent is the following: (full stack trace available at https://pastebin.com/raw/Xk4wVDmD)



      Caused by: java.lang.RuntimeException: Couldn't find count(DISTINCT notice_sender)#419L in [domain_name#13,sum(cast(num_of_url#14 as double))#415,sum(cast(num_of_dup_urls#16 as double))#416,count(notice_sender#10)#417L]
      at scala.sys.package$.error(package.scala:27)



      Initially I though this was because some features such as distinct or subqueries were not available, but I am using spark 2.4 and everything seems fine to that end. (I have also tested each of the components separately and there doesn't seem to be an issue). If anyone has an idea of where I am going wrong, any help would be much appreciated.







      apache-spark pyspark apache-spark-sql pyspark-sql






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 25 at 17:36









      ben steerben steer

      577 bronze badges




      577 bronze badges






















          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55343571%2funclear-parse-errors-when-translating-complex-psql-query-to-sparksql%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55343571%2funclear-parse-errors-when-translating-complex-psql-query-to-sparksql%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현