cwielenb/CNCF-Dataset huggingface dataset:
Project: StarRocks (App Definition and Development / Database)
File: max_by.md

displayed_sidebar: "English" Returns the value of `x` associated with the maximum value of `y`. For example, `SELECT maxby(subject, examresult) FROM exam;` is to return the subject that has the highest exam score. This function is supported from v2.5. ```Haskell max_by(x,y) ``` `x`: an expression of any type. `y`: an expression of a type that can be ordered. Returns a value that has the same type as `x`. `y` must be a sortable type. If you use an unsortable type of `y`, such as `bitmap` or `hll`, an error is returned. If `y` contains a null value, the row that corresponds to the null value is ignored. If more than one value of `x` has the same maximum value of `y`, this function returns the first value of `x` encountered. Create a table `exam`. ```SQL CREATE TABLE exam ( subject_id INT, subject STRING, exam_result INT ) DISTRIBUTED BY HASH(`subject_id`); ``` Insert values into this table and query data from this table. ```SQL insert into exam values (1,'math',90), (2,'english',70), (3,'physics',95), (4,'chemistry',85), (5,'music',95), (6,'biology',null); select * from exam order by subject_id; ++--+-+ | subjectid | subject | examresult | ++--+-+ | 1 | math | 90 | | 2 | english | 70 | | 3 | physics | 95 | | 4 | chemistry | 85 | | 5 | music | 95 | | 6 | biology | null | ++--+-+ 6 rows in set (0.03 sec) ``` Obtain the subject that has the highest score. Two subjects `physics` and `music` have the same highest score `95` and the first subject encountered (`physics`) is returned. ```Plain SELECT maxby(subject, examresult) FROM exam; ++ | maxby(subject, examresult) | ++ | physics | ++ 1 row in set (0.01 sec) ```
Project: KICS (Provisioning / Security & Compliance)
File: 9b0ffadc-a61f-4c2a-b1e6-68fab60f6267.md

title: Group With Privilege Escalation By Actions 'cloudformation:CreateStack' And 'iam:PassRole' hide: toc: true navigation: true <style> .highlight .hll { background-color: #ff171742; } .md-content { max-width: 1100px; margin: 0 auto; } </style> Query id: 9b0ffadc-a61f-4c2a-b1e6-68fab60f6267 Query name: Group With Privilege Escalation By Actions 'cloudformation:CreateStack' And 'iam:PassRole' Platform: Terraform Severity: <span style="color:#ff7213">Medium</span> Category: Access Control URL: Group with privilege escalation by actions 'cloudformation:CreateStack' and 'iam:PassRole' and Resource set to '*'. For more information see https://rhinosecuritylabs.com/aws/aws-privilege-escalation-methods-mitigation/.<br> ```tf title="Positive test num. 1 - tf file" hl_lines="1" resource "awsiamgroup" "cosmic" { name = "cosmic" } resource "awsiamgrouppolicy" "testinline_policy" { name = "testinlinepolicy" group = awsiamgroup.cosmic.name policy = jsonencode({ Version = "2012-10-17" Statement = [ { Action = [ "cloudformation:CreateStack", ] Effect = "Allow" Resource = "*" }, ] }) } resource "awsiampolicy_attachment" "test-attach" { name = "test-attachment" groups = [awsiamgroup.cosmic.name] policyarn = awsiam_policy.policy.arn } resource "awsiampolicy" "policy" { name = "test-policy" description = "A test policy" policy = jsonencode({ Version = "2012-10-17" Statement = [ { Action = [ "iam:PassRole", ] Effect = "Allow" Resource = "*" }, ] }) } ``` ```tf title="Negative test num. 1 - tf file" resource "awsiamuser" "cosmic2" { name = "cosmic2" } resource "awsiamuserpolicy" "inlinepolicyruninstances2" { name = "inlinepolicyrun_instances" user = awsiamuser.cosmic2.name policy = jsonencode({ Version = "2012-10-17" Statement = [ { Action = [ "ec2:Describe*", ] Effect = "Allow" Resource = "*" }, ] }) } ```
Project: Beam (App Definition and Development / Streaming & Messaging)
File: portaltelemedicina.md

title: "Portal Telemedicina" icon: /images/logos/powered-by/portaltelemedicina.png hasLink: "https://portaltelemedicina.com.br/" <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->
Project: StarRocks (App Definition and Development / Database)
File: curdate.md

displayed_sidebar: "English" Obtains the current date and returns a value of the DATE type. ```Haskell DATE CURDATE() ``` ```Plain Text mysql> SELECT CURDATE(); ++ | curdate() | ++ | 2024-03-27 | ++ mysql> SELECT CURRENT_DATE(); +-+ | current_date() | +-+ | 2024-03-27 | +-+ mysql> SELECT CURDATE() + 0; +--+ | (curdate()) + 0 | +--+ | 20240327 | +--+ mysql> SELECT CURDATE() +2; +--+ | (curdate()) + 2 | +--+ | 20240329 | +--+ mysql> SELECT CURDATE() - INTERVAL 5 DAY; +-+ | curdate() - INTERVAL 5 DAY | +-+ | 2024-03-22 00:00:00 | +-+ mysql> SELECT QUARTER(CURDATE()); +--+ | quarter(curdate()) | +--+ | 1 | +--+ ```
Project: EMQ Technologies (App Definition and Development / Streaming & Messaging)
File: v5.0.23.en.md

Change the priority of the configuration: If it is a new installation of EMQX, the priority of configuration is `ENV > emqx.conf > HTTP API`. If EMQX is upgraded from an old version (i.e., the cluster-override.conf file still exists in EMQX's data directory), then the configuration priority remains the same as before. That is, `HTTP API > ENV > emqx.conf`. Deprecated data/configs/local-override.conf. Stabilizing the HTTP API for hot updates. More specific error messages when configure with bad maxheapsize value. Log current value and the max value when the `messagequeuetoo_long` error is thrown. Metrics now are not implicitly collected in places where API handlers don't make any use of them. Instead, a separate backplane RPC gathers cluster-wide metrics. Deprecate the trace.payload_encode configuration. Add payload_encode=[text,hidden,hex] option when creating a trace via HTTP API. Unify the config formats for `cluster.core_nodes` and `cluster.statics.seeds`. Now they both support formats in array `["emqx1@127.0.0.1", "emqx2@127.0.0.1"]` or semicolon-separated string `"emqx1@127.0.0.1,emqx2@127.0.0.1"`. Hide a large number of advanced options to simplify the configuration file. That includes `rewrite`, `topicmetric`, `persistentsessionstore`, `overloadprotection`, `flappingdetect`, `conncongestion`, `stats,autosubscribe`, `brokerperf`, `sharedsubscriptiongroup`, `slowsubs`, `ssloptions.userlookupfun` and some advance items in `node` and `dashboard` section, , , . A new function to convert a formatted date to an integer timestamp has been added: datetounix_ts/3 Change the default queue mode for buffer workers to `memory_only`. Before this change, the default queue mode was `volatile_offload`. When under high message rate pressure and when the resource is not keeping up with such rate, the buffer performance degraded a lot due to the constant disk operations. Optimize the configuration priority mechanism to fix the issue where the configuration changes made to `etc/emqx.conf` do not take effect after restarting EMQX. More introduction about the new mechanism: Simplify the configuration of the limiter feature and optimize some codes Rename `message_in` to `messages` Rename `bytes_in` to `bytes` Use `burst` instead of `capacity` Hide non-importance fields Optimize limiter instances in different rate settings Simplify the configuration of the `retainer` feature. Mark `flow_control` as non-importance field. Fix error in `/api/v5/monitor_current` API endpoint that happens when some EMQX nodes are down. Prior to this fix, sometimes the request returned HTTP code 500 and the following message: ``` {"code":"INTERNAL_ERROR","message":"error, badarg, [{erlang,'++',[{error,nodedown},[{node,'emqx@10.42.0.150'}]], ... ``` Fix config check failed when gateways are configured in emqx.conf. This issue was first introduced in v5.0.22 via , the boot-time config check was missing.
Project: YDB (App Definition and Development / Database)
File: pickle.md

`Pickle()` and `StablePickle()` serialize an arbitrary object into a sequence of bytes, if possible. Typical non-serializable objects are Callable and Resource. The serialization format is not versioned and can be used within a single query. For the Dict type, the StablePickle function pre-sorts the keys, and for Pickle, the order of dictionary elements in the serialized representation isn't defined. `Unpickle()` is the inverse operation (deserialization), where with the first argument being the data type of the result and the second argument is the string with the result of `Pickle()` or `StablePickle()`. Examples: ```yql SELECT * FROM my_table WHERE Digest::MurMurHash32( Pickle(TableRow()) ) %10 ==0; -- actually, it is better to use TABLESAMPLE $buf = Pickle(123); SELECT Unpickle(Int32, $buf); ```
Project: Athenz (Provisioning / Key Management)
File: zts_rolecert.md

ZTS Role Certificate Client utility uses Athenz Service Identity certificate to request a X509 Certificate for the requested role from ZTS Server. Once ZTS validates the service identity certificate, it will issue a new 30-day X509 Certificate for the role. Unlike access tokens, role certificates are issued for a given role only. Download latest ZTS Role Certificate Client utility binary release from : click on the `Browse` button, choose the latest version directory and then download the `athenz-utils-<latest-version>-bin.tar.gz`. ```shell $ tar xvfz athenz-utils-X.Y-bin.tar.gz ``` Before you can use the ZTS RoleCertificate utility, you need to have asked the Athenz administrators to create your top level domain. -- Role X.509 certificates can only be requested using Athenz x.509 Identity certificates. Typically you configure your service identity agent (SIA) to automatically fetch and refresh the role certificates. ``` $ zts-rolecert -svc-key-file <key-file> -svc-cert-file <cert-file> -zts https://zts-server.athenzcompany.com:4443/zts/v1 -role-domain <domain> -role-name <name> -dns-domain <dns-domain> [-role-cert-file <output-cert-file>] ```
Project: KICS (Provisioning / Security & Compliance)
File: 869e7fb4-30f0-4bdb-b360-ad548f337f2f.md

title: Redis Cache Allows Non SSL Connections hide: toc: true navigation: true <style> .highlight .hll { background-color: #ff171742; } .md-content { max-width: 1100px; margin: 0 auto; } </style> Query id: 869e7fb4-30f0-4bdb-b360-ad548f337f2f Query name: Redis Cache Allows Non SSL Connections Platform: Ansible Severity: <span style="color:#ff7213">Medium</span> Category: Insecure Configurations URL: Redis Cache resources should not allow non-SSL connections<br> ```yaml title="Positive test num. 1 - yaml file" hl_lines="5" name: Non SSl Allowed azurermrediscache: resource_group: myResourceGroup name: myRedis enablenonssl_port: yes ``` ```yaml title="Negative test num. 1 - yaml file" name: Non SSl Disallowed azurermrediscache: resource_group: myResourceGroup name: myRedis enablenonssl_port: no name: Non SSl Undefined azurermrediscache: resource_group: myResourceGroup name: myRedis ```
Project: Podman (App Definition and Development / Application Definition & Image Build)
File: podman-volume-reload.1.md

% podman-volume-reload 1 podman\-volume\-reload - Reload all volumes from volumes plugins podman volume reload podman volume reload checks all configured volume plugins and updates the libpod database with all available volumes. Existing volumes are also removed from the database when they are no longer present in the plugin. This command it is best effort and cannot guarantee a perfect state because plugins can be modified from the outside at any time. Note: This command is not supported with podman-remote. Reload the volume plugins. ``` $ podman volume reload Added: vol6 Removed: t3 ``` ,
Project: YugabyteDB (App Definition and Development / Database)
File: integer-for-loop.md

title: Integer for loop [YSQL] headerTitle: The "integer for loop" linkTitle: Integer for loop description: Describes the syntax and semantics of the integer for loop. [YSQL] menu: stable: identifier: integer-for-loop parent: loop-exit-continue weight: 20 type: docs showRightNav: true Here's a minimal example that shows the use of all the optional syntax elements: ```plpgsql \c :db :u drop schema if exists s cascade; create schema s; create function s.f() returns table(z text) set searchpath = pgcatalog, pg_temp language plpgsql as $body$ begin <<"Loop-1">>for j in reverse 60..5 by 13 loop z := j::text; return next; end loop "Loop-1"; end; $body$; select s.f(); ``` This is the result: ```output 60 47 34 21 8 ``` A name that requires double-quoting was used as the label simply to emphasize that this choice is, of course, legal. Notice that the loop variable, j, isn't explicitly declared. The code works because the defined semantics of this kind of loop include the implicit declaration of the loop variable as an integer (and, surprisingly, not as a bigint). The semantics can be understood unambiguously be re-writing it as an infinite loop, thus: ```plpgsql declare j int not null := 60; begin <<"Loop-1">>loop exit when j < 5; z := j::text; return next; j := j - 13; end loop "Loop-1"; end; ``` This rewrite makes it clear that, if j had been earlier declared in an enclosing block statement's declaration section, then the implicitly declared loop variable, j, would simply shield it from the earlier-declared i in accordance with the normal rules for nested block statements. You can rewrite an example of any of the four other kinds of loop (the while loop, the integer for loop, the array foreach loop, and the query for loop) as an infinite loop. And sometimes mutual rewrite is possible between other pairs of kinds of loop statement. For example, an array foreach loop can be re-written as an integer for loop over the array's index values. The present example could have been re-written as a while loop (while j >= 5). The infinite loop is the most flexible kindand therefore you cannot always rewrite this kind of loop as another kind (unless you use an artificial device that adds no valuelike while true loop).
Project: Operator Framework (App Definition and Development / Application Definition & Image Build)
File: openapi-validation.md

title: OpenAPI validation linkTitle: OpenAPI validation weight: 70 OpenAPIv3 schemas are added to CRD manifests in the `spec.validation` block when the manifests are generated. This validation block allows Kubernetes to validate the properties in a Memcached Custom Resource when it is created or updated. (annotations) are available to configure validations for your API. These markers will always have a `+kubebuilder:validation` prefix. Usage of markers in API code is discussed in the kubebuilder and documentation. A full list of OpenAPIv3 validation markers can be found . To learn more about OpenAPI v3.0 validation schemas in CRDs, refer to the .
Project: ArangoDB (App Definition and Development / Database)
File: error_code_throw_as_system_error_outcome.md

+++ title = "`errorcodethrowassystem_error<T, EC, EP>`" description = "Policy class defining that `EP` ought to be rethrown if possible, then the ADL discovered free function `outcomethrowassystemerrorwithpayload()` should be called on incorrect wide value observation. Inherits publicly from `base`. Can only be used with `basic_outcome`." +++ Note: This policy class specialisation can only be used with `basicoutcome`, not `basicresult`. Use {{% api "errorcodethrowassystemerror<T, EC, void>" %}} with `basicresult`. Policy class defining that on incorrect wide value observation, `EP` ought to be rethrown if possible, then the ADL discovered free function `outcomethrowassystemerrorwithpayload(impl.assume_error())` should be called. . Incorrect wide error observation performs: ```c++ BOOSTOUTCOMETHROWEXCEPTION(badoutcome_access("no error")); ``` Incorrect wide exception observation performs: ```c++ BOOSTOUTCOMETHROWEXCEPTION(badoutcome_access("no exception")); ``` Inherits publicly from {{% api "base" %}}, and its narrow value, error and exception observer policies are inherited from there. Requires: Nothing. Namespace: `BOOSTOUTCOMEV2_NAMESPACE::policy` Header: `<boost/outcome/policy/outcomeerrorcodethrowassystemerror.hpp>`
Project: Backstage (App Definition and Development / Application Definition & Image Build)
File: http-router.md

id: http-router title: Http Router Service sidebar_label: Http Router description: Documentation for the Http Router service One of the most common services is the HTTP router service which is used to expose HTTP endpoints for other plugins to consume. The following example shows how to register a HTTP router for the `example` plugin. This single route will be available at the `/api/example/hello` path. ```ts import { coreServices, createBackendPlugin, } from '@backstage/backend-plugin-api'; import { Router } from 'express'; createBackendPlugin({ pluginId: 'example', register(env) { env.registerInit({ deps: { http: coreServices.httpRouter }, async init({ http }) { const router = Router(); router.get('/hello', (_req, res) => { res.status(200).json({ hello: 'world' }); }); // Registers the router at the /api/example path http.use(router); }, }); }, }); ``` This service does not have any configuration options.
Project: KICS (Provisioning / Security & Compliance)
File: 05fb986f-ac73-4ebb-a5b2-7faafa93d882.md

title: Root CA File Not Defined hide: toc: true navigation: true <style> .highlight .hll { background-color: #ff171742; } .md-content { max-width: 1100px; margin: 0 auto; } </style> Query id: 05fb986f-ac73-4ebb-a5b2-7faafa93d882 Query name: Root CA File Not Defined Platform: Kubernetes Severity: <span style="color:#ff7213">Medium</span> Category: Encryption URL: When using kube-controller-manager commands, the '--root-ca-file' should be defined<br> ```yaml title="Positive test num. 1 - yaml file" hl_lines="11" apiVersion: v1 kind: Pod metadata: name: command-demo labels: purpose: demonstrate-command spec: containers: name: command-demo-container image: gcr.io/google_containers/kube-controller-manager-amd64:v1.6.0 command: ["kube-controller-manager"] args: [] restartPolicy: OnFailure ``` ```yaml title="Negative test num. 1 - yaml file" apiVersion: v1 kind: Pod metadata: name: command-demo labels: purpose: demonstrate-command spec: containers: name: command-demo-container image: gcr.io/google_containers/kube-controller-manager-amd64:v1.6.0 command: ["kube-controller-manager"] args: ["--root-ca-file=/path/to/ca/file.pem"] restartPolicy: OnFailure ``` ```yaml title="Negative test num. 2 - yaml file" apiVersion: v1 kind: Pod metadata: name: command-demo labels: purpose: demonstrate-command spec: containers: name: command-demo-container image: gcr.io/google_containers/kube-controller-manager-amd64:v1.6.0 command: ["kube-controller-manager","--root-ca-file=/path/to/ca/file.pem"] args: [] restartPolicy: OnFailure ```
Project: ClickHouse (App Definition and Development / Database)
File: undrop.md

slug: /en/sql-reference/statements/undrop sidebar_label: UNDROP Cancels the dropping of the table. Beginning with ClickHouse version 23.3 it is possible to UNDROP a table in an Atomic database within `databaseatomicdelaybeforedroptablesec` (8 minutes by default) of issuing the DROP TABLE statement. Dropped tables are listed in a system table called `system.dropped_tables`. If you have a materialized view without a `TO` clause associated with the dropped table, then you will also have to UNDROP the inner table of that view. :::tip Also see ::: Syntax: ``` sql UNDROP TABLE [db.]name [UUID '<uuid>'] [ON CLUSTER cluster] ``` Example ```sql CREATE TABLE tab ( `id` UInt8 ) ENGINE = MergeTree ORDER BY id; DROP TABLE tab; SELECT * FROM system.dropped_tables FORMAT Vertical; ``` ```response Row 1: index: 0 database: default table: tab uuid: aa696a1a-1d70-4e60-a841-4c80827706cc engine: MergeTree metadatadroppedpath: /var/lib/clickhouse/metadata_dropped/default.tab.aa696a1a-1d70-4e60-a841-4c80827706cc.sql tabledroppedtime: 2023-04-05 14:12:12 1 row in set. Elapsed: 0.001 sec. ``` ```sql UNDROP TABLE tab; SELECT * FROM system.dropped_tables FORMAT Vertical; ```response Ok. 0 rows in set. Elapsed: 0.001 sec. ``` ```sql DESCRIBE TABLE tab FORMAT Vertical; ``` ```response Row 1: name: id type: UInt8 default_type: default_expression: comment: codec_expression: ttl_expression: ```
Project: YugabyteDB (App Definition and Development / Database)
File: authorization-platform.md

title: Authorization headerTitle: Authorization linkTitle: Authorization description: Use the role-based access control (RBAC) model in YugabyteDB Anywhere to manage users and roles. menu: v2.18_yugabyte-platform: parent: security identifier: authorization-platform weight: 27 type: docs The role-based access control (RBAC) model in YugabyteDB Anywhere is a collection of privileges on resources given to roles. Thus, the entire RBAC model is built around roles, resources, and privileges. It is essential to understand these concepts in order to understand the RBAC model. A user can interact with a YugabyteDB Anywhere through the UI or REST API. A role is a set of predefined permissions within YugabyteDB Anywhere. The following roles are available: Super Admin* is the first user that is created during the tenant registration. This role has the highest level of privilege that allows all read and write actions on all YugabyteDB Anywhere resources. There can be only one Super Admin in a tenant. This Super Admin can perform the following: Manage all resources, including universes, nodes, backup and restore, and cloud providers. Manage the user access control by creating and managing users. For more information, see . Admin* has privileges that are similar to the Super Admin, except that the Admin cannot manage the global scope artifacts and actions, such as runtime configuration settings and LDAP authentication. Backup Admin* has access the backup related tasks, such as the following: Manage database backups and restore operations. Create new backups. Delete any existing backup or backup schedule. Edit existing backups. Read-only permissions for all other resources in YugabyteDB Anywhere. Read-only* access level provides viewer permission to the UI and API. As a Super Admin or Admin, you can invite new users and manage existing users for your tenant. You can invite new users to your tenant as follows: Navigate to Admin > User Management > Users and click Add User*. Complete the fields of the Add User dialog shown in the following illustration, and then click Submit*: To modify a user role or delete the user, navigate to Admin > User Management > Users. Click Actions that corresponds to the specific user, and then select either Edit User Role or Delete User.
Project: StarRocks (App Definition and Development / Database)
File: Tableau_Desktop.md

displayed_sidebar: "English" Tableau Desktop supports querying and visualizing both internal data and external data in StarRocks. Create a database in Tableau Desktop: Take note of the following points: Select Other Databases(JDBC) as the data source. For Dialect, select MySQL. For URL, enter a URL in the MySQL URI format as below: ```SQL jdbc:mysql://<Host>:<Port>/<Catalog>.<Databases> ``` The parameters in the URL are described as follows: `Host`: the FE host IP address of your StarRocks cluster. `Port`: the FE query port of your StarRocks cluster, for example, `9030`. `Catalog`: the target catalog in your StarRocks cluster. Both internal and external catalogs are supported. `Database`: the target database in your StarRocks cluster. Both internal and external databases are supported. Configure Username and Password. Username: the username that is used to log in to your StarRocks cluster, for example, `admin`. Password: the password that is used to log in to your StarRocks cluster.