You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by 38797715 <38...@qq.com> on 2022/01/06 09:34:41 UTC
HASH_JOIN: Index "HASH_JOIN_IDX" not found
Execute the following script and the error will occur:
CREATE TABLE Country (
Code CHAR(3) PRIMARY KEY,
Name VARCHAR,
Continent VARCHAR,
Region VARCHAR,
SurfaceArea DECIMAL(10,2),
IndepYear SMALLINT,
Population INT,
LifeExpectancy DECIMAL(3,1),
GNP DECIMAL(10,2),
GNPOld DECIMAL(10,2),
LocalName VARCHAR,
GovernmentForm VARCHAR,
HeadOfState VARCHAR,
Capital INT,
Code2 CHAR(2)
) WITH "template=partitioned, backups=1, CACHE_NAME=Country,
VALUE_TYPE=demo.model.Country";
CREATE TABLE City (
ID INT,
Name VARCHAR,
CountryCode CHAR(3),
District VARCHAR,
Population INT,
PRIMARY KEY (ID, CountryCode)
) WITH "template=partitioned, backups=1, CACHE_NAME=City,
KEY_TYPE=demo.model.CityKey, VALUE_TYPE=demo.model.City";
CREATE INDEX idx_country_code ON city (CountryCode);
INSERT INTO City(ID, Name, CountryCode, District, Population) VALUES
(1,'Kabul','AFG','Kabol',1780000);
INSERT INTO City(ID, Name, CountryCode, District, Population) VALUES
(2,'Qandahar','AFG','Qandahar',237500);
INSERT INTO Country(Code, Name, Continent, Region, SurfaceArea,
IndepYear, Population, LifeExpectancy, GNP, GNPOld, LocalName,
GovernmentForm, HeadOfState, Capital, Code2) VALUES
('AFG','Afghanistan','Asia','Southern and Central
Asia',652090.00,1919,22720000,45.9,5976.00,NULL,'Afganistan/Afqanestan','Islamic
Emirate','Mohammad Omar',1,'AF');
SELECT *
FROM city,country USE INDEX(HASH_JOIN_IDX)
WHERE city.CountryCode = country.code;
see the doc:
https://ignite.apache.org/docs/latest/SQL/distributed-joins#hash-joins
why?
is a bug?