Is it possible to pass LIVE VIEW name as a parameter in Clickhouse query? - clickhouse

For example, like
CREATE LIVE VIEW %(live_view_name)s WITH REFRESH
It works only with other parameters (WHERE condition) but not with view name.

Look like you use python for make HTTP query?
I think it's not possible because parameter value will escape as string literal, not as field name
Look to
https://clickhouse.com/docs/en/interfaces/http#cli-queries-with-parameters
and
https://clickhouse.com/docs/en/interfaces/cli#cli-queries-with-parameters
and try to use CREATE LIVE VIEW {live_view_name:Identifier} WITH REFRESH

Related

Using a Content ID Contextual Filter in a Views Block in Drupal 8

I am attempting to create a View that, instead of showing a list of all nodes of a content type, will show only a single node of a content type based on node ID. In Drupal 7, I worked almost exclusively in Views Content Panes and was able to achieve this based on NID and then setting the Argument Input to From Context: Content ID. How do I get similar results using Blocks in Drupal 8?
I have a view that is correctly configured to show all nodes of a content type. I've tried to add a Contextual Filter: ID; but I cannot figure out how to configure it to get a result that isn't All Results.
Thank you in advance!
When you edit the contextual filter Content ID, you have :
WHEN THE FILTER VALUE IS NOT AVAILABLE (base view is built without filter, this is the case)
Check Provide default value to set how filter values should be retrieved, then you can choose a type, for example Content ID from URL, or Query parameter, etc.
For example with Query parameter you can set the parameter name and the Fallback value. In your case you would set something like nid as the query param, and all or a fixed node ID as fallback value ('all' is the exception value by default that is to disable the filter).
Given this example, you 'd just add the query ?nid=5 to the request path. It seems you need the block filtered by default though, in this case just set a fixed node ID (eg. 5 instead of all) as fallback value in views admin, then the block will be filtered by default the same way.

Use a Field value in a Query (Seblod Query plugin)

I'm using the Query plugin that lets me create a Query field on my List & Search.
I have a hidden field with ID 'id_number' which I'm trying to use in my query. When I check the Page Source(Ctrl+U on Chrome), the hidden field has the correct value of id_number which is '22865'.
The part of my Query is-
WHERE [MATCH]p.pid||$cck->getValue('id_number')[/MATCH] AND (ban_reason in ("", "active"))
When I print this query out using the Debugger, the Query is using the literal value and querying the above as-
(p.pid LIKE '%$cck->getValue(\'id\_number\')%') ....and not like (p.pid LIKE '%22865%')
I also tried using $fields['id_number']->value but it still queries it incorrectly.
Should I not use $cck->getValue('id_number') to get the value of the hidden field in the query? Or is there something other than this that I need to use?

Searching an expression logic in informatica mappings

Is it possible to search an expression code, in multiple informatica mappings with out manually going through the mapping? Say like exporting the mapping into an XML or anything similar.
Example :
I need to search if we are using an expression where we check if a field is NULL like below :
IF(ISNULL(PORT1), CONDITION1, CONDITION2)
I need to search say N number of mappings to check if i am using ISNULL function anywhere in the mapping, as we are going to replace all the NULL's in the database with default values and setting all the fields to NOT NULL, and in the informatica logic, if we are explicitly checking for ISNULL conditions, we would have to recode the logic.
Basically i need to do impact analysis, and need to check if and where there is an ISNULL condition used, it should be replaced with default values instead. say the above condition looks like below :
IF(PORT1='', CONDITION1, CONDITION2)
Any assistance would extremely be appreciated.
Export all workflows from repository manager as a single xml. Then search for the expression. If this is something you need to do frequently, you can consider writing script utility script to do this and return the list of mapping names.
The easiest way is by exporting the wf into xml and do search and replace using any text editor and then import the wf using repository manager.
If you want to check this is happening under sql override query then use repository query on meta data tables.

DEVEXPRESS How can I pass multiple values in a report parameter to a query param?

I created a parameter IdWorker in the report, and in the parameter properties I have assigned these default values: 'w00012', 'w00013', 'w00014' and I created the parameter as a string. If I add only one value then it works, but the problem is when I want to add more than one value :
I also created a query with a parameter paramIdWorker:
When I add only one value the query works correctly, but when I add more values the query returns no results. How can I add multiple values to a parameter?
I accept suggestions thanks.

CouchDB Views: created_at greater than a passed value

I'm trying to write a couchdb view that takes a created_at timestamp in a sortable format (2009/05/07 21:40:17 +0000) and returns all documents that have a greater created_at value.
I'm specifically using couch_foo but if I can figure out how to write the view I can create it in futon or in the couch_foo model instead of letting couch_foo do it for me.
I've searched all around and can't figure out the map/reduce to do this, if it's possible.
This is the kind of problem I ran into initially before I fully understood how views work.
The key to the understanding is that the view is only run once for each (revision of) a document. In other words, when you query a view, you don't run the function, you simply look up the results of when the function ran. As such, there is no way to pass any user-submitted parameters into a view.
How then to compare a value in a view with a user-submitted value? The secret is to emit that field as a key in the map function and rely on letting couchdb order by the keys.
Your map function would be something like
"map" : "function(doc) { emit(doc.created_at, doc); }"
and you would query it like so:
http://localhost:5984/db/_design/ddoc/_view/view?startkey=%222009/05/07%2021:40:17 +0000%22
I have taken the liberty of uriEncoding the quotes and spaces in the url so that it should be usable as is.
You want to write a view that creates a key of the timestamp field in that format, then query it with the startkey parameter.
So the view would look something like:
"map" : "function(doc) { emit(doc.timestamp_field, doc) }"
And your URL would be something like:
http://mysever/database/_design/mydoc/_view/myview?startkey="2009/05/07 21:40:17 +0000"
The HTTP view API page on the Wiki has more info. You may also consider the User Mailing List.
Please mind that couchdb works only on json values. If the timezone if the document stored in couchdb is different to the timezone of your startkey the query likely will fail.

Resources