final class HashMethod
    implements PartitionMethod
    uses Snapshot
Public API: explicitly declared with @visibility public.

[LINEAR] HASH (expression): partitioning by the value of an expression modulo the number of partitions.

Mirrors PT_part_type_def_hash and PT_sub_partition_by_hash. The expression is derived in the scope of the partitioned table. Source: https://dev.mysql.com/doc/refman/8.4/en/partitioning-hash.html.

Holding a hash partitioningdoctest
$method = new \SqlSemantics\Platform\MySql\Statement\Partition\Method\HashMethod(false, new \SqlSemantics\Platform\MySql\Statement\Name\ColumnUse(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('id')));
    [$method->linear, $method->expression->name->value] // => [false, 'id']

Properties§

public bool $linear
public Scalar $expression

Methods§

public function __construct(public bool $linear, public Scalar $expression)

Parameters

$linearboolWhether LINEAR is written
$expressionScalarThe partitioning expression
public function deriveMethod(Derivation $derivation, Environment $scope): void

Derives the expression in the scope of the table.

Parameters

$derivationDerivation
$scopeEnvironment
Calls 1
public function render(Output $out): void

Writes the method.

Parameters

$outOutput
Calls 1

Test cases 2§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 1

Relations§

Instantiated in 1
Type checks 1