use sparksql in Idea but not find table - apache-spark-sql

In spark-shell,I execute the sentence:"spark.table("show tables").show",It can show the list of table in my hive.But the same sentence in Idea not word.It can't find anyone.
I have set the $SPARK_HOME/conf in my Modules' dependencies with the runtime scope.The hive-site.xml is work.
help me please.

I have find the answer.It must use the enableHiveSupport().I am foolish

Related

Fishbase-API get-query

I would like to use the Fishbase-API in my app.
https://fishbase.ropensci.org/
here is the README for the API...
https://fishbaseapi.readme.io/reference/getting-started
But I don't know how to create a correct query to search for certain “common names” (comnames) and get a list of results?
Thanks a lot!

Configure SQLFluff rules

I use SQLFluff to ensure a uniform syntax in the company and reduce error warnings before running the models in dbt. Since our syntax does not completely match the syntax of SQLFluff I would like to make some changes.
The Rules References provided by SQLFluff helped me to set up Inline Ignoring Errors, as displayed in the code below (last line of code).
So I have two questions, which I was not able to answer also with the help of the Rules References of SQLFluff.
I would like to set Rule L032 as default 'false' without typing it manually every time in my SQL.
How do I change the maximal length of a line regarding Rule L016? I would like to set the default value e.g. 150.
SELECT
country.country_name,
country.population,
currency.currency_name,
currency.currency_id,
currency.strange_long_variable_name_which_is_too_long as not_so_long_variable_name
FROM country
LEFT JOIN currency
USING (country) -- noqa: L032
I tried to figure it out with the Rules References but could not figure it out. Help is very much appreciated!
Try looking into .sqlfluff config file
https://docs.sqlfluff.com/en/stable/configuration.html#
With the help of #suhprano's answer, I was able to find the proper solution for my issue. For this reason, I will post an answer to my own question. I do this intending to provide others assistant with similar issues.
I created the .sqlfluff file in my user profile folder. In this file I have then included the following:
[sqlfluff]
exclude_rules = L032
[sqlfluff:rules]
max_line_length = 150
In this case, SQLFluff will load the configuration from any .sql file found at the path specified on this variable.
Just an addition to the answer:
The default config of the rules can be found inside the package in file core\default_config.cfg
See also:
https://github.com/sqlfluff/sqlfluff/blob/main/src/sqlfluff/core/default_config.cfg
https://docs.sqlfluff.com/en/stable/configuration.html#defaultconfig
As already mentioned by #Albin the easiest way to override the config is to add a .sqlfluff file in the user profile folder.
See also:
https://docs.sqlfluff.com/en/stable/configuration.html#rule-configuration

Define additional variables for file name pattern in Dbeaver?

While exporting the resultset i could only find 2 variables that can be used to name a file(table and timestamp).
Does anyone know if custom variables/patterns can be created? I looked for some documentation online, however I couldn't find any.
On DBeaver 5.2.4, there is a tooltip when you hover your cursor to the "File name pattern" textfield. It says, allowed variables are: ${datasource}, ${catalog}, ${schema}, ${table}, ${timestamp}, ${date}, and ${project}.
I wish it could help.
Those options have changed to:
${host}
${database}
${table}
${date}
${timestamp}
v6.1.5

Clear all records from a store

I have a store, I am loading records from it successfully. Now i need to clear all the records in it. How can i do this ?
myStore.remove(); // DID NOT WORK
myStore.clear(); // ENDED UP WITH AN ERROR TypeError: myStore.clear is not a function
How could i solve this?
Remove will remove the records you pass in. You want removeAll as in myStore.removeAll();
I find out that, at least on ExtJS 4.2.3, removeAll give an error the first time it is issued after a load. I got it resolved by doing:
store.clearData();
store.removeAll();
myStore.loadData([],false); is the solution.
I'm using version 2.0.12 and none of the above solutions worked. I read their readme.md and found store.clearAll();.
That was my solution.

MSbuild built in variables

Could someone translate this, into a syntax that uses the built in variables?
\\myserver\builds\mybuild\Daily_20090525.1\Release\_PublishedWebsites\myWebsite
it should be something like:
$(DropLocation)\mybuild\$(?...)\Release\_PublishedWebsites\myWebsite
This might help:
substitute "mybuild\$(?...)" with "$(BuildNumber)"
I had a similar problem where I was trying to copy from the drop location to a "Latest" folder. I found that to construct the final destination of the files (\MyServer\MyShare\builds\MyBuild\Daily_20090708.14\Mixed Platforms\Release) translated to the following using variables:
$(DropLocation)\$(BuildNumber)\%(ConfigurationToBuild.PlatformToBuild)\%(ConfigurationToBuild.FlavorToBuild)
I also found it helpful to use the Message task for troubleshooting. The following task will tell you what the variable translate to.
<Message Text="$(DropLocation)\$(BuildNumber)\%(ConfigurationToBuild.PlatformToBuild)\%(ConfigurationToBuild.FlavorToBuild)\"/>
To see the output, look in BuildLog.txt.
PS: My tasks that used the properties and items mentioned above where located inside <Target Name="AfterDropBuild">.